
22 Jul
2006
22 Jul
'06
9:07 a.m.
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.