$segment =~ s/^\d{2}(?!\d)/testtext/;
which YAPE::Regex::Explain describes as
NODE EXPLANATION
----------------------------------------------------------------------
^ the beginning of the string
----------------------------------------------------------------------
\d{2} digits (0-9) (2 times)
----------------------------------------------------------------------
(?! look ahead to see if there is not:
----------------------------------------------------------------------
\d digits (0-9)
----------------------------------------------------------------------
) end of look-ahead
----------------------------------------------------------------------
Some side notes:
- The language is Perl, the interpreter is perl; there is no 'PERL' (excluding when I get very excited about Perl. And who doesn't?)
- If this is class-work, please qualify it as such. We are all happy to help beginners learn and help you debug, but Monks doing work for you won't help you learn. It also tends to raise ire in the Monastery.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|