Well, I was thinking of the string after the "=" being long, but the greedy version still wins. Perhaps the regex works from the back even when non-greedy?
My (incorrect, apparently) thinking was that /[^=]+=/ will have to check the whole string to make sure there isn't a second "=" later on while /[^=]+?=/ could just stop at the first "=" (provided the rest of the regex matched). I'd be interested in any insights on this. [ Didn't I make this exact same mental error before... I'll have to go check and then double check the read-only tab on my brain ]
- tye (but my friends call me "Tye")In reply to RE: RE: (tye)Re: Regular expression to match an A=B type string needs help in storing matched parts of string
by tye
in thread Regular expression to match an A=B type string needs help in storing matched parts of string
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |