Interesting little regex

Jason Hall jayce at lug-nut.com
Thu Feb 23 10:01:00 MST 2006


Alan Young wrote:
> In trying to get something done a co-worker came up with this little regex:
> 
> perl -e '$a="abcde"x200;$a=~s{((\w+?)(??{!$b{$^N}++?"(?=)":"(?!)"}))}{($1)}xg;print
> "$a\n";'
> 

You've got the x flag, please use it!

--
Jayce^



More information about the PLUG mailing list