
5 Oct
2008
5 Oct
'08
3:58 p.m.
Raindog wrote:
Eric,
I was recently hit by a stack overflow due to the way xpressive makes recursive calls when dealing with patterns like *_, etc and was wondering if there is an alternative, more efficient way of matching these types of patterns.
Actually for a pattern like *_, xpressive doesn't use recursion. Only for more complicated (that is, variable-width) repeated sub-expressions does xpressive use recursion.
p.s I know about keep() but that can get cumbersome to use everywhere.
I'm afraid that's what I was going to suggest. Don't use it everywhere ... just where you can afford to turn off backtracking. -- Eric Niebler BoostPro Computing http://www.boostpro.com