in reply to Re: Re: Getting element of array with a match
in thread Getting element of array with a match
Sure, that's the sort of way I would usually code it myself but you then have to (potoentially) explain how that single line works. There is also an implicit requirement in your code that the comma imediately follows the id as well as having no leading whitespace. All probably true but... You should have either used qr// or /o in your code BTW ;-)
For those that are wondering the \Q...\E is the regex version of quotemeta which ensures that interpolated strings do not blow up your regex when they contain metachars. It is always sound practice to use \$Q$string\E in regexes.
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: Getting element of array with a match
by Arien (Pilgrim) on Dec 24, 2002 at 05:04 UTC | |
by tachyon (Chancellor) on Dec 24, 2002 at 05:18 UTC |