Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It is true that regular expressions in the CS sense can't parse context-free grammars. However, PCRE, which is what most programmers are talking about when they say "regex", can do so. So you're both kinda right, I guess. But you're being a bit pedantic.


> But you're being a bit pedantic.

Technically-correct is the best kind of correct:-)

But I do think it's important to note, since there really are differences between regular and 'regular' expressions.


> PCRE, which is what most programmers are talking about

I wish that were the case. http://www.regular-expressions.info/refunicode.html

(They used to have a much more useful and concise comparison table but I can't for the life of me find it.)


Interesting; I've never had to think about how regex interact with Unicode.

I guess what I really meant is that programmers are talking about PCRE in terms of power, not in terms of exact syntax. In particular, they have recursive patterns, which are sufficient to pull them up to context-free grammars.


It definitely can get pedantic in a topic like this, but when all of the interesting bits are in the nuances, I don't mind so much.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: