in reply to Re: Re: regex match question
in thread regex match question
Basically, it would be less confusing to learn about zero-width assertions.$str =~ s/^%q|([^%])%q/$1/g;
Granted, it does pose a bit of a challenge to "learn" the various zero-width and non-grouping forms. I haven't memorized them yet myself -- I just scan through the "perlre" man page every time I need to use one of those "(?whatever)" thingies. I actually don't mind that. I'm used to it from always having to do the same thing for a dozen different common C library calls -- I still do that, after "knowing" C for 15 years.
|
|---|