in reply to Re: Integrating match counts into regex matching
in thread Integrating match counts into regex matching
You used "(?<!a)" and "(?!b)" as anchors, so your solution was designed to match a substring, but it doesn't work for 'a_abb' (false negative) and 'a_abbb' (false positive).
for (qw[ ab abb abbb aabb aabbb aabbbb a_abb a_abbb ]) { m[ (?<!a) (?> (a+) (?{ length($^N) }) (b+) ) (?(?{ length($^N)-$^R != 1 })(?!)) ]x and print("$_\n"); }
abb aabbb a_abb
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Integrating match counts into regex matching
by BrowserUk (Patriarch) on Dec 19, 2008 at 09:29 UTC |