Keep It Simple, Stupid | |
PerlMonks |
Re: A Regex simple Questionby Sidhekin (Priest) |
on Sep 06, 2007 at 15:54 UTC ( [id://637464]=note: print w/replies, xml ) | Need Help?? |
Negative lookahead is always tricky ... you're on the right track though. In this specific case you could do this:
... or even this:
... unless I've read you wrong, and you want to allow the string "ab" and even "ab000b"/"a000ab" (since the "ab" is not strictly between the "a" and the "b"), in which case you want this:
... or even this:
Always tricky, the negative lookahead ... if you can split it, like FunkyMonk suggests (or some variation thereof), it'll be far more readable.
print "Just another Perl ${\(trickster and hacker)},"
In Section
Seekers of Perl Wisdom
|
|