Colin Brewster

Greenhorn
+ Follow
since Jun 18, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Colin Brewster

Hi

I'm not sure why that isn't working for you, it looks fine to me although there are a few unnecessary escapes and a rogue "?" in the expression you posted, though for me they dont cause any exception to be thrown.

This is a slightly cleaner version of your expression that works fine for me: "^\\+?[-0-9]()\\s,-/\\\\]*"

If you just use "\\\\" on it's own do you still get the exception? Maybe it's environmental?
15 years ago
Hi Prach

Could you post some sample code showing your problem? "\\\\" works fine for me.

Thanks
15 years ago
\\ matches the backslash character, so for example if the expression is entered from a console that would match. However if the pattern is created from a string literal then you would need "\\\\" (double backslashes are required for a backslash in string literals).
15 years ago
Hi

\\ should match \, basically you are escaping the backslash itself.

If you need the expression as a string in code you will need to use "\\\\"
15 years ago
Welcome Jim , Jim and Eric - looks like a great book!
15 years ago