@@ -70,7 +70,7 @@ template<typename CharT, int min_count, int max_count, int kind> class range_tok
7070#line 673 "cpp2regex.h2"
7171template <typename CharT, typename matcher_wrapper> class regular_expression ;
7272
73- #line 756 "cpp2regex.h2"
73+ #line 760 "cpp2regex.h2"
7474}
7575}
7676
@@ -149,7 +149,7 @@ template<typename CharT, typename Iter, int max_groups> class match_context
149149
150150 private: std::array<match_group<Iter>,max_groups> groups {};
151151
152- public: match_context(Iter const & begin_, Iter const & end_);
152+ public: explicit match_context (Iter const & begin_, Iter const & end_);
153153
154154#line 68 "cpp2regex.h2"
155155 public: match_context(match_context const & that);
@@ -212,7 +212,7 @@ template<typename Func> class on_return
212212 {
213213 private: Func func;
214214
215- public: on_return(Func const & f);
215+ public: explicit on_return (Func const & f);
216216#line 136 "cpp2regex.h2"
217217 public: auto operator =(Func const & f) -> on_return& ;
218218
@@ -577,7 +577,7 @@ template<typename CharT, typename matcher_wrapper> class regular_expression
577577 public: context<Iter> ctx;
578578 public: int pos;
579579
580- public: search_return(cpp2::impl::in<bool > matched_, context<Iter> const & ctx_, Iter const & pos_);
580+ public: explicit search_return (cpp2::impl::in<bool > matched_, context<Iter> const & ctx_, Iter const & pos_);
581581
582582#line 690 "cpp2regex.h2"
583583 public: [[nodiscard]] auto group_number () const & -> decltype(auto );
@@ -608,7 +608,7 @@ template<typename CharT, typename matcher_wrapper> class regular_expression
608608 public: [[nodiscard]] auto search (cpp2::impl::in<bview<CharT>> str, auto const & start, auto const & length) const & -> decltype(auto );
609609 public: template <typename Iter> [[nodiscard]] auto search (Iter const & start, Iter const & end) const & -> search_return<Iter>;
610610
611- #line 742 "cpp2regex.h2"
611+ #line 746 "cpp2regex.h2"
612612 public: [[nodiscard]] auto to_string () const & -> decltype(auto );
613613
614614 // Helper functions
@@ -619,7 +619,7 @@ template<typename CharT, typename matcher_wrapper> class regular_expression
619619 public: auto operator =(regular_expression const &) -> void = delete ;
620620
621621
622- #line 754 "cpp2regex.h2"
622+ #line 758 "cpp2regex.h2"
623623};
624624
625625}
@@ -1171,15 +1171,19 @@ template<typename CharT, bool negate> [[nodiscard]] auto word_boundary_token_mat
11711171 if (cur == ctx.end ) {
11721172 break ;
11731173 }
1174+
1175+ if (matcher<Iter>::is_start_match ()) {
1176+ break ; // Always break with \G option.
1177+ }
11741178 }
11751179
11761180 return search_return<Iter>(r.matched , cpp2::move (ctx), cpp2::move (r).pos );
11771181 }
11781182
1179- #line 742 "cpp2regex.h2"
1183+ #line 746 "cpp2regex.h2"
11801184 template <typename CharT, typename matcher_wrapper> [[nodiscard]] auto regular_expression<CharT,matcher_wrapper>::to_string() const & -> decltype (auto ) { return matcher_wrapper::to_string (); }
11811185
1182- #line 746 "cpp2regex.h2"
1186+ #line 750 "cpp2regex.h2"
11831187 template <typename CharT, typename matcher_wrapper> [[nodiscard]] auto regular_expression<CharT,matcher_wrapper>::get_iter(cpp2::impl::in<bview<CharT>> str, auto const & pos) -> auto {
11841188 if (cpp2::impl::cmp_less (pos,str.size ())) {
11851189 return str.begin () + pos;
@@ -1189,7 +1193,7 @@ template<typename CharT, bool negate> [[nodiscard]] auto word_boundary_token_mat
11891193 }
11901194 }
11911195
1192- #line 756 "cpp2regex.h2"
1196+ #line 760 "cpp2regex.h2"
11931197}
11941198}
11951199
0 commit comments