in reply to Regular expression to match an A=B type string needs help in storing matched parts of string

Oh, and I'll say this again. If you have ANY control over your input string, then you can match EXPLICITLY what you want. If you know the string is going to be in the form before-the-equals-sign='in-the-quotes', then you don't NEED to do
$string =~ /[^=]+='([^']+)'/;
If you are confident, just doing
$string =~ /='([^']+)'/;
is enough. It may not be 100 times faster, but it's less noise to look at.

$_="goto+F.print+chop;\n=yhpaj";F1:eval
  • Comment on Re: Regular expression to match an A=B type string needs help in storing matched parts of string
  • Select or Download Code