Michael Heerdegen writes: > > The LPEG people wrote a paper[*] about this problem. The converter is more or less done - see below. Feedback welcome! Nearly everything regexps support is implemented. I tried to make everything so that the resulting peg is really equivalent to the given regexp - please tell me if you find a translation where this is not respected. Remaining problems: (1) Group numbering currently has to be explicit - unnumbered groups are silently treated as shy. That's because getting the numbering right is not trivial. I implemented groups and backrefs using an uninterned global variable owned by the peg. It would be better to add built-in support to peg.el if we want that feature. (2) Transforming character ranges to the vector representation that peg.el uses is not trivial. I would welcome help to get it done correctly. A possible (slow) fallback solution is a guard calling `looking-at' followed by an (any). Oh - why I think this conversion code is useful? It's nice for learning but also for cases were a regexp would almost suffice but you need some Elisp guard somewhere in the middle of matching the regexp to examine the buffer at that position.