3 ms·
If you really want to master Regular Expressions in a way you are not likely to forget do what I did in the '80s. Write a regex interpreter and then a compiler
by DonGateley 13y ago
If you really want to master Regular Expressions in a way you are not likely to forget do what I did in the '80s. Write a regex interpreter and then a compiler. I was doing a contract for an embedded controller and found a great use for compiled regular expressions within it (I remember every nuance of regular expressions but can't for the life of me remember what my use case was.)
Debugging it was the really fun part but my earlier career with IBM had taught me how to test software effectively and some embedded work with PAL's (an early form of programmable logic) taught me how to really use state machines. I was surprised how little time it took to write and debug. I don't think you can really appreciate the elegant logic of the regular expression language without implementing it.