in reply to Whats your favorite nonstandard regex quote char?
It all depends on what I'm doing... If it's a script that I'll use more than once, I tend to lean towards readability. If it's an obfuscation, I go for confusion of course.
For what should be obvious reasons, these are some of my personal favorites:
s@{.*?}@{$sub[$n++]}@g;
s${.*?}${$sub[$n++]}$g;
s%{.*?}%{$sub[$n++]}%g;
s={.*?}={$sub[$n++]}=g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Whats your favorite nonstandard regex quote char?
by demerphq (Chancellor) on Apr 22, 2003 at 15:56 UTC | |
by DrManhattan (Chaplain) on Apr 22, 2003 at 21:51 UTC | |
by demerphq (Chancellor) on Apr 22, 2003 at 22:06 UTC | |
by crenz (Priest) on Apr 22, 2003 at 22:10 UTC | |
by Mr. Muskrat (Canon) on Apr 22, 2003 at 15:57 UTC | |
|
Re: Re: Whats your favorite nonstandard regex quote char?
by diotalevi (Canon) on Apr 22, 2003 at 15:56 UTC | |
by demerphq (Chancellor) on Apr 22, 2003 at 16:13 UTC | |
|
Re^2: Whats your favorite nonstandard regex quote char? (backslash)
by Aristotle (Chancellor) on Apr 26, 2003 at 02:56 UTC |