views:

84

answers:

3

I'm going over this in my theory class, and I'm curious as to how many people here know what regular expression compilation actually is. I've looked online, and it seems to me that this is a more archaic topic that I thought it was.

So yeah, who here knew before reading this question that a regular expression compile is performed by converting the regex to an epsilon-nondeterministic finite automaton? Who has no clue what that is?

A: 

Ok. I guess I'll be the first one to admit that, although I took a compiler's course a couple years ago and know the general principle of it, I think I would need to bring out the "Dragon Book" again and read up some more on the subject if I were actually asked to write the code that does this kind of thing.

Michael Aaron Safyan
A: 

There's a very simple and elegant little regular expression compiler in C that Rob Pike wrote and Brian Kernighan describes in Chapter 1 of O'Reilly's Beautiful Code. It's pretty easy to learn from. Also compiler courses cover it: token types can be defined with regular expressions. So I imagine this knowledge isn't terribly rare.

Jim Ferrans
A: 

I knew it had something to do with finite state machines, but nothing beyond that. Not really a subject I wanted to delve into... I suspect it's nasty under the hood. Not many people on SO seems how to use regular expressions at all, nevermind understand how they work.

Mark