News for hackers. Stuff that matters.
Re:Why Using .* in Regular Expressions Is Almost Never What ... by Pxtl on Wednesday June 04, 2014 @10:05AM (#7845579)
I've gotten into the habit of using the "not" operation instead of .* a lot. If I'm looking for bracketed text, I use not-bracket to match the contents.

I tend to avoid the non-greedy operator just because it often fails in terrible half-assed regex implementations (eg. visual studio 2010)

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.

Re:Why Using .* in Regular Expressions Is Almost Never What ... by blueblob on Wednesday June 04, 2014 @12:40PM (#7846589)
Me too. I find that if you work in a bunch of different languages it seems more portable (and one less thing to remember). It also seems easier to debug.