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.
In reply to Re^3: a regular expression question
by roboticus
in thread a regular expression question
by brassbin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |