[boost:regex]does boost:regex support char set substraction?

Hi all, I got another problem here while trying using boost:regex: does boost:regex support char set substraction? For example:I give boost:regex an expression"[a-z]-[d-f]".I would like the boost take the second "-" as and substracion. So this expression is supposed to be translated as "[a-c]|[f-z]".I am wonderring whether boost:regex has such substraction symbols? Thanks && Regards Juan

gj_uestc wrote:
Hi all, I got another problem here while trying using boost:regex: does boost:regex support char set substraction?
For example:I give boost:regex an expression"[a-z]-[d-f]".I would like the boost take the second "-" as and substracion. So this expression is supposed to be translated as "[a-c]|[f-z]".I am wonderring whether boost:regex has such substraction symbols?
No, but you can simulate subtraction with lookahead/lookbehind, for example: subtraction: (?=[a-z])[^d-f] Intersection: (?=[a-z])[d-f] HTH, John.
participants (2)
-
gj_uestc
-
John Maddock