
Hi Eric, Eric Niebler wrote:
(Sorry for the delay, I just got back from a week-long vacation.)
Andreas Pokorny wrote:
Do you see a nicer solution?
Hi Andreas. I *also* recently made nested regexes work for dynamic regexes, and I made an announcement about it on this list not too long ago. See here: http://lists.boost.org/Archives/boost/2007/06/122641.php.
Oh dear, I switched from my old gmx email account to the gmail based for boost, there are still 7k unread boost messages.
In particular, see "Dynamic Regex Grammars with Named Regexes", which has the following example:
sregex_compiler comp; sregex rx = comp.compile("^bar(?$RE)baz$"); comp.compile("(?$RE=)\\d+ \\d+");
The regex_compiler holds a map from names to regex objects. The first call to compile() creates a forward reference to a regex object named "RE" and the second call binds a regex to the name "RE".
Is this the sort of thing you had in mind? (This is only available in the repository -- no public release has this feature yet.)
(?$ looks like an assertion. I wanted to use that feature to implement configureable/extensible syntax highlighting withing quickbook. What happens if you add RE regex line e.g. comp.compile("(?$RE=)\\w+ "); Did you consider a different syntax for specifiying named regular expressions, or is (?$=) and (?$) something that exists in other regex engine? Regards Andreas Pokorny