laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
+ is a special character in regular expressions that means match one or more of what is before me... your regexp will match one or more a's followed by a b... i.e. aaab ab aaaaaab, to match a plus you must escape it, using a \ so \+ will match a plus... see perlre
Update Doh, my eyes skipped the lower text... :) you need the \\ because "" interploates data, thus converting \+ to + before it gets to the regexp... if you use single quotes 'a\+b' then you will be ok. - Ant In reply to Re: matching the + character
by suaveant
|
|