We all have to pass through doubt. The trick is to keep going once you're in it.
My advice to favor minimal matching is pragmatic. I've seen a lot more people get themselves into trouble using greedy matching than with non-greedy matching (when forming the part of the regex intended to skip over stuff that's not interesting). Since one way through doubt is to try a few experiments, the odds favor going minimal. This also plays the odds that you experiment succeeds on a small number of tests cases, but fails in the wild.
In reply to Re^5: $1 and regex
by dws
in thread $1 and regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |