News for hackers. Stuff that matters.
Re:Why Using .* in Regular Expressions Is Almost Never What ... by prohor on Wednesday June 04, 2014 @09:30AM (#7845392)
A bit of a problem with lazy quantifiers is that they are not so widely supported out of the perl world. Therefore I often need to find some tricks to get similar behavior (eg. "[^,]*," - if coma is separator)
Re:Why Using .* in Regular Expressions Is Almost Never What ... by hnriot on Wednesday June 04, 2014 @09:40AM (#7845440)
Except they are! Java, python, JavaScript etc all support lazy quantifies. In fact I can't think of a single language that doesn't.
Re:Why Using .* in Regular Expressions Is Almost Never What ... by mkehrt on Wednesday June 04, 2014 @06:35PM (#7848850)
Except bash, awk, sed and vim. So, everywhere I use regular expressions.
Re:Why Using .* in Regular Expressions Is Almost Never What ... by fmoralesc on Thursday June 05, 2014 @04:18PM (#7854119)
vim has \- and variants.
Re:Why Using .* in Regular Expressions Is Almost Never What ... by caio1982 on Wednesday June 04, 2014 @10:07AM (#7845591)
Sed doesn't AFAIK.
Re:Why Using .* in Regular Expressions Is Almost Never What ... by BugBrother on Wednesday June 04, 2014 @09:38AM (#7845431)
Huh, PCRE is universal (almost, not in e.g. Emacs :-( ) and supports (almost) everything?

Edit: Cough, after rechecking... PCRE is not as universal as I thought. It seems I've been lucky. :-) http://en.wikipedia.org/wiki/Comparison_of_regular_expressio...

Edit 2: "Atomic groups" on that wikipedia link is when you can write a full grammar in a large regexp, right? Answer myself: No, it is the name for stopping backtracking. I've seen it as named "possessive" (perldoc perlre).

Re:Why Using .* in Regular Expressions Is Almost Never What ... by SiVal on Thursday June 05, 2014 @03:00AM (#7850592)
I thought it was becoming more universal, but now I'm not so sure.

grep on the Mac used to use PCRE regexes if you used the -P option (`grep -P ....`), but beginning with OS X 10.8 the -P option was removed, so an important place that used to offer PCRE (default grep on a default Mac) actually removed support for it. They didn't replace it with something better; they just took it away. Maybe a Unicode issue?

Not only is PCRE not universal, overall support might even be waning.

Re:Why Using .* in Regular Expressions Is Almost Never What ... by collyw on Wednesday June 04, 2014 @01:30PM (#7846920)
MySQL doesn't have them, it has some POSIX version, which is way less intuitive. Plenty of people use MySQL.
Re:Why Using .* in Regular Expressions Is Almost Never What ... by BugBrother on Wednesday June 04, 2014 @04:18PM (#7847931)
Isn't that part of an SQL standard (1999?).