Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2007-05-01 05:15:09


Lorenzo Bettini wrote:
> Hi
>
> is there a way to specify open and closed parenthesis with a
> regular expression syntax? For instance, if I'd want to specify a
> single regular expression that matches both (foo) and [foo] and {foo}?

Probably not what you wanted, but:

[(\[{]foo[)\]}]

sort of does what you want, but if you want to ensure that the brackets
match up, then it's down to:

\[foo\]|\(foo\)|\{foo\}

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk