tags:

views:

105

answers:

4

In learning Regular Expressions it had me wondering how the underlying engine works. Probably more specifically, I'd like to know more about how it evalutates, prioritizies and parses the expression. I feel the RegEx engine is a blackbox to me, and I would really enjoy deciphering it.

So I'd like to ask if there are some great resources that I could read up on that discuss RegEx engine theory.

*Note: I am not interested in building an engine, just learning the inner workings of it.

A: 

Read:

http://www.regular-expressions.com

Try:

http://www.regexbuddy.com/

RegexBuddy is highly recommended. It will show you how the regex engines processes an input and also breaks down regexes so they are easy to understand.

NullUserException
+3  A: 

Regular Expression engines are based on finite-state machines. A nice article about how fast regular expression matching works is http://swtch.com/~rsc/regexp/regexp1.html.

Giuseppe Cardone
A: 

Take some book about Authomata Theory.

Also good articles can be found there: http://swtch.com/~rsc/regexp/

Vadim Shender
+6  A: 
MizardX
It looks like I have some work cut out for me with the posted links but I believe this is more what I was looking for. Even further if you know of an actual book that could be purchased, that would be fantastic.
Robb
I haven't read many books on the subject, but one I liked is "Introduction to the Theory of Computation" by Michael Sipser. It is not just about Regular Expressions, but goes all the way to Turing Machines and NP-completeness, etc.
MizardX