3 ms·
I feel that regex is kind of like SQL -- it's universal enough that knowing the major tropes is important for general software development.
by dimino 10y ago
I feel that regex is kind of like SQL -- it's universal enough that knowing the major tropes is important for general software development.
- hvidgaard 10y agoProblem is that every framework have their own dialect of it, and many of them are not even regular expression, but something beyond that.
- thedufer 10y agoThe most common dialect is PCRE. Most languages have an implementation of either that or a superset of it.
- hvidgaard 10y agoThe most common dialect is PCRE. Most languages have an implementation of either that or a superset of it. PCRE isn't exactly simple to begin with. That languages may implement it, or a superset of it, is exactly the problem. I know regular expressions very well, or rather I know regular languages and can fairly easily identify if a problem is solvable as a regular expressions. But once you start to go beyond that, it's not simple anymore and the benefit of a regular expression is lost.
- thedufer 10y agoIf you know what . does, various repetition markers (*,+,?,{}), and character classes, you're 90% there. Back-references are another big portion, although that's admittedly where things start getting a bit complex.