24 Feb
2009
24 Feb
'09
9:12 a.m.
I have two problems that I would need some help. Thanks in advance.
Question 1:
Please consider the regular expression to match US phone number below:
((\(\d{3}\)?)|(\d{3}))([\s-./]?)(\d{3})([\s-./]?)(\d{4})
boost doesn't like it and it will throw an exception for the code below while it seems to be fine in online regex tester and .Net Regex library. I don't know what is imcompatiable with boost regex library. Please advice.
How are the expressions entered in the program? If they're string literals then don't forget that you need to double up those backslashes (once for the compiler, once for the regex engine): const char* re = "((\\(\\d{3}\\)?)|(\\d{3}))([\\s-./]?)(\\d{3})([\\s-./]?)(\\d{4})"; HTH, John.