4 ms·
While I agree that this is verbose to the point of almost being absurd, the regex syntax is far from universal. There are several different variations that are
by throwaway2016a 10y ago
While I agree that this is verbose to the point of almost being absurd, the regex syntax is far from universal. There are several different variations that are different in annoyingly subtle ways.
- qwertyuiop924 10y agoHow so? The differences between PCRE and Python RE are negligable, and cannot be confused for any syntax in the other. Most people use ERE with only the most commonly implemented PCREisms in any case. And BRE is different enough that it's usually detactable right off the bat.
- throwaway2016a 10y agoIf you don't switch between them frequently enough it can be very difficult to deal with. For example, when doing a search in vim I often confuse what needs to be escaped and what doesn't vs a grep. And the escape syntax between perl compatible regexs and mySQL regexs are significantly different. They are subtle but they can cost valuable time while mentally context switching between them.
- qwertyuiop924 10y agoThe first is BRE vs ERE. Honestly, just use egrep. It behaves more in the way you'd expect. I'm not really sure what so different about the escape syntax in mySQL. But I'm sure you know.
- throwaway2016a 10y agomySQL regex is a bit of a nightmare. It contains a lot of character classes that can be confusing if you don't use them often. I guess "escape syntax" is the wrong phrase. http://dev.mysql.com/doc/refman/5.7/en/regexp.html http://dev.mysql.com/doc/refman/5.7/en/regexp.html
- qwertyuiop924 10y agoAh. I was confused, because it uses Spencer's regex package, which is pretty standard for parsing and matching ERE.