No such thing as a small change | |
PerlMonks |
RE: Probably silly regex question / not so silly regex questionby BlaisePascal (Monk) |
on Aug 01, 2000 at 23:20 UTC ( [id://25552]=note: print w/replies, xml ) | Need Help?? |
I'm gonna think on the several parts of "question 1", but "the other question" is easy...
The regex /.*c/ will match the longest prefix that ends in c. So if fed "acrobatic cockatoos can fly", it would match "acrobatic cockatoos c". The regex /[^c]*c/ would match the first prefix that ends in c, or "ac".
As far as /.*?c/ goes... I think that is roughly equivilant to /[^c]*c/, but I'm not positive.
In Section
Seekers of Perl Wisdom
|
|