in reply to Whats your favorite nonstandard regex quote char?
So what are the monks at large opinion on this ever so trivial a subject? Which alternate regex delimiter do you favour? And what are the arguments behind your opinion (if any)?
I prefer []. Except for the RHS with s///e, because I prefer {} there.
[] is VERY easy to read, Data::Dumper B::Deparse uses it a lot and it will make even more sense when we have Perl 6's regexes, where [] is used for grouping.
{} often delimits code. It makes sense with s///e because the RHS is code, and creates scope, etc etc.
I escaped the {} to be on the safe side when something is added in front of it in a future version.s[\{.*?\}][{$sub[$n++]}]gx;
Also note that syntax highlighting helps more than choosing the right delimiter.
Juerd
- http://juerd.nl/
- spamcollector_perlmonks@juerd.nl (do not use).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Whats your favorite nonstandard regex quote char?
by demerphq (Chancellor) on Apr 22, 2003 at 20:21 UTC | |
by Juerd (Abbot) on Apr 22, 2003 at 20:32 UTC |