Opened 12 years ago

Closed 12 years ago

#4270 closed Bugs (worksforme)

Hexadecimal range problem.

Reported by: renhawking@… Owned by: John Maddock
Milestone: Boost 1.44.0 Component: regex
Version: Boost 1.42.0 Severity: Problem
Keywords: Cc:

Description

Sorry for my english.

There is a problem with hexadecimal ranges, in perl it is posible to do this: \x5A[\x00-\xCC]{12}\x5A to match almost all hexadecimal numbers, but it's not possible to do it with booost regex.

I get this runtime error when I try to run it:

Character set declaration starting with [ terminated prematurely - either no ] was found or the set had no content. The error occured while parsing the regular expression: 'Z[>>>HERE>>>'.

Thank you

Change History (1)

comment:1 by John Maddock, 12 years ago

Resolution: worksforme
Status: newclosed

Works for me: don't forget that if you're embedding the expression in your program as a string literal, then it becomes "
x5A[
x00-
xCC]{12}
x5A" since the compiler gobbles up the first \.

HTH, John.

PS if you still have a problem, please reopen and post a self-contained test case along with details of the compiler and platform used.

Note: See TracTickets for help on using tickets.