in reply to Regular expression to match an A=B type string needs help in storing matched parts of string
Note that your regex will match a bit faster if you change "+" to "+?":
if ( $gpa_ret =~ /[^=]+?[=][']([^']+)[']/ ) {
The speed-up can be significant if you have really long strings that match.
For your second question I'd like to note that I often find myself wanting @1 so that I could get the list of matches that a grouping matched!
- tye (but my friends call me "Tye")
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: (tye)Re: Regular expression to match an A=B type string needs help in storing matched parts of string
by japhy (Canon) on Sep 21, 2000 at 21:56 UTC | |
by tye (Sage) on Sep 21, 2000 at 22:12 UTC | |
by japhy (Canon) on Sep 21, 2000 at 22:28 UTC |