Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
cmazakas committed Oct 30, 2024
1 parent 93cc45a commit 6567738
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions include/boost/regex/v5/perl_matcher_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,14 +591,32 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_backref()
}while((r.first != r.second) && ((*m_presult)[index].matched != true));
}

if((m_match_flags & match_perl) && !(*m_presult)[index].matched)
if((m_match_flags & match_perl) && !(*m_presult)[index].matched){
return false;
}

auto const& submatch = (*m_presult)[index];
BidiIterator i = submatch.get_first();
BidiIterator j = submatch.get_second();

{
auto ic = i;
auto jc = j;
auto curr = 0;
while(ic != jc) {
++ic;
if(++curr >= 5000) {
boost::throw_exception(std::runtime_error("lmao no way bro, it's over"));
}
}
}

BidiIterator i = (*m_presult)[index].first;
BidiIterator j = (*m_presult)[index].second;
while(i != j)
{
if((position == last) || (traits_inst.translate(*position, icase) != traits_inst.translate(*i, icase)))
if((position == last))
return false;

if((traits_inst.translate(*position, icase) != traits_inst.translate(*i, icase)))
return false;
++i;
++position;
Expand Down

0 comments on commit 6567738

Please sign in to comment.