Re:Why Using .* in Regular Expressions Is Almost Never What ...
by bane on Wednesday June 04, 2014 @12:36PM
(#7846567)
I wish the not operator allowed for sub-expressions instead of just character classes. It'll probably make it slower, but it would remove lots of unreadable convolutions people have to go through.
Re:Why Using .* in Regular Expressions Is Almost Never What ...
by ori_b on Wednesday June 04, 2014 @01:59PM
(#7847086)
There are some regex implementations that allow it, but it's a very confusing feature. Remember that '' is not 'a'.
Arbitrary expressions can have arbitrary length, so excluding an expression simply will match it, fail the match, and backtrack to the next option.
I tend to avoid the non-greedy operator just because it often fails in terrible half-assed regex implementations (eg. visual studio 2010)