Problems? Is your data what you think it is? | |
PerlMonks |
silly regex questionby batkins (Chaplain) |
on Jan 19, 2003 at 00:30 UTC ( [id://228096]=perlquestion: print w/replies, xml ) | Need Help?? |
batkins has asked for the wisdom of the Perl Monks concerning the following question:
hi monks.
i'm trying to write a regular expression that will replace all single quotes (') not contained in <%...%> tags with a separate string. i've been trying for some time now and feel like a moron for not being able to get it. here's what i've come up with: s/(%>.*)'(.*<%)/${1}test$2/g; it even seems to work in test cases. but when i apply it to this file: it doesn't do anything. any idea why? thanks for your help and let me know if you need any more info.
Back to
Seekers of Perl Wisdom
|
|