Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Welcome Guest | Log In | Register | Benefits
Channels ▼
RSS

Embedded Systems

Irregular Expressions



Related Reading


More Insights




AlWilliams

Thanks Matt. Yes regexp are a black art in "consumer applications" I'm afraid.

AlWilliams

Well, in all honesty I am pirating the C compiler for my own purposes and that makes it more of a quick hack.

SN000

"start + space + zero_or_more + any_of("ABC") + literal(":") "

Mostly an interesting aside, but this is how you would construct a regular expression parser using a library of parsing combinators like Parser/FParsec in a functional language like Haskell or F#. The nice thing is that once you've done this you've got not just a regular expression but a working regex parser!

MattFL

Am I the only one who gets frustrated that most email applications don't support regex in the search? Ditto for Quicken, Quick Books, etc.. Come to think of it.. I can't think of a single end user application sold to the general public that supports regex in the search function! How can this be? ;)

Great article btw.

Rob Stewart

After complaining about tools that don't process stdin and write to stdout, I'm shocked to see that your tool doesn't read stdin (or a file given on the command line) for the "easy-regex" language input. I know that means you'd have to parse the language you've created, but the essential logic remains the same.

AlWilliams

Hi Dave,

Oops that should have been tenet, shouldn't it? My bad.

Check out this web site: http://regex101.com/

or http://www.myezapp.com/apps...

or

RegEx Hero (pro version) will also do that.

Thanks for the note.

DaveTaflin

UNIX has tenants? Did I miss the Occupy UNIX Movement? Seriously, this looks useful, thanks. What would it take to produce a standard expression interpreter that takes a standard expression as input and outputs something more readable for us mortals who would like to understand some existing gobbledygook expression?