Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regular Expression problem

Status
Not open for further replies.

Laeg

Programmer
Nov 29, 2004
95
IE
Dim rx As New Regex("/^0\d{1,3)-\d{5,7}/")

If(Not(rx.IsMatch("01-12345")))Then
' Why is this executed?
End if

Can anyone tell me why the pattern above does not match the string?
 
A couple things:
1. Your regex requires the '/' character
2. You have a ')' instead of a '}'

try
"^\d{1,3}-\d{5,7}"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top