From: John Maddock (john_at_[hidden])
Date: 2006-07-22 05:07:46


Winson Yung wrote:
>> Hello all, I have the following regular expression, but it doesn't
>> match to this text "REVENUE
>> ................................................... $10,481.1"
>>
>> const char* pattern[] = "Revenue[\s\.]*\$?\s*([0-9,\.]*)";

Don't you need to double up those escapes? Remember that C++ consumes the
first \ so you need \\ to pass an escape to the regex engine:

const char* pattern[] = "Revenue[\\s\\.]*\\$?\\s*([0-9,\\.]*)";

HTH, John.