Re: boost::regex: regex meta data or AST for regex?
Seth Heeren <[email protected]> Sun, 17 Jan 2021 23:28:10 +0100
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
On zo, 17. jan 09:48, Frank Bergemann wrote: > On 17.01.21 09:33, Frank Bergemann wrote: > > more general: > > Can an AST be created for a the given regex string (c'tor argument)? > > E.g with boost::spirit? I'm not completely sure why you would want this, but here's something that I made before that might give you inspiration: https://stackoverflow.com/questions/7657130/how-to-get-the-ast-of-a-regular-expression-string/21419351#21419351 Also, are you aware of Boost Xpressive? It's only tangentially related, but in its core it has "static regexes" which are really Spirit-style template expressions. The linking element here could be that you can make the group matches trigger semantic actions just like in spirit, which already tells you what part of the regular expression is involved. Cheer, Seth