dim pattern as String =" ^\(\d{3}\) \d{3}-\d{4}$"
dim pattern2 as String="^\d{3}-\d{3}-\d{4}$"
If Regex.IsMatch(yourString, pattern) orelse Regex.IsMatch(yourString,
pattern2) then
'-- Match made. Do whaterver
End If
"Troy" <ma****@pushit.com> wrote in message
news:eH*************@TK2MSFTNGP10.phx.gbl...
thanks for the quick answer but can I bother you to show me how to
implement your suggestion with system.text.regularexpression name space?
thanks
"Some Guy" <my*****@there.com> wrote in message
news:11*************@corp.supernews.com... Quick answer.
Start with this. You should combine them into one.
^\(\d{3}\) \d{3}-\d{4}$-------(XXX) XXX-XXXX
^\d{3}-\d{3}-\d{4}$--------- XXX-XXX-XXXX
"Troy" <ma****@pushit.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... Hello,
I'd like to validate an input my from user i.e. make sure that the user
enters the phone number is the following formats
(XXX) XXX-XXXX
XXX-XXX-XXXX
Any ideas on how I can achieve this with regular expressions? Having
difficulty wrapping my head around it.
thanks