|
Posted by Rik on 06/10/06 00:55
Tim wrote:
> Yeah thats it.
>
> (.+)\s{2}
>
> Is a greedy match, it will match to the last two spaces it finds and
> not the first.
> Adding a ? after the brackets make it a non greedy match.
>
> (.+)?\s{2}
Good explanation, totally correct, but nort the right regex:
(.+)?\s{2}
means:
(A random character 1 or mor times) zero or once.
explanation was good, regex should be:
(.+?)\s{2}
As I've learned, correct me if I'm wrong, the ? to make a selector
non-greedy should be directly after the selector itself AFAIK.
Grtz,
--
Rik Wasmus
[Back to original message]
|