Short answer, the regex engine works left to right.
Long answer, go read Friedl's articles in The Perl Journal or his book on Mastering Regular Expressions.
In reply to Re: Why is this regex greedy?
by kscaldef
in thread Why is this regex greedy?
by pbeckingham
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |