in reply to Re^2: a regular expression question
in thread a regular expression question
As toolic mentioned, the .* construct is greedy and tries to get the longest match. If you turn it into .*?, it then looks for the shortest match. If you read the link he provided, you could verify that yourself.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: a regular expression question
by brassbin (Novice) on Dec 18, 2012 at 17:07 UTC | |
|
Re^4: a regular expression question
by brassbin (Novice) on Jan 29, 2013 at 14:29 UTC | |
|
Re^4: a regular expression question
by brassbin (Novice) on Dec 18, 2012 at 22:39 UTC |