Perl-Sensitive Sunglasses | |
PerlMonks |
Re: shortening substitutionsby Thilosophy (Curate) |
on Jun 17, 2005 at 11:25 UTC ( [id://467660]=note: print w/replies, xml ) | Need Help?? |
Why do you want to do that?
These four statements are very readable, combining them into one complex one would result in less readily understandable code.
In addition to that, I think an equivalent single regex would be tricky to think of. Just consider the delicate details:
Some of these complexities are maybe in error. I do not know what you are trying to do, of course, but perhaps you want to strip all quotation marks, not only the first one. Once you need to debug code, four simple regex are easier to grasp than one complex regex. So, I would suggest to stick with what you have now.
In Section
Seekers of Perl Wisdom
|
|