Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby, etc)

"This is a tale of two approaches to regular expression matching. One of them is in widespread use in the standard interpreters for many languages, including Perl. The other is used only in a few places, notably most implementations of awk and grep. The two approaches have wildly different performance characteristics ..."
A very interesting article on regular expression matching algorithms.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Wow, the article shows how

Wow, the article shows how quicker the Thompson algorithm is...

...in a worst possible expression for the backtracking algorithm and (I fail to ignore it) if the regular expression is longer then 75 characters. Let's write an infinite regexp! Smile