|
-
May 5th, 2005, 12:08 PM
#1
Thread Starter
Frenzied Member
Regular expressions
Hi
I need a regex to validate a string that must ends with "/" and 2 digits
Examples
"aaa/" not ok
"aaa/0a" not ok
"bdc/88" ok
Thanks
Jorge
Last edited by Asgorath; May 5th, 2005 at 12:16 PM.
"The dark side clouds everything. Impossible to see the future is."
-
May 5th, 2005, 01:44 PM
#2
Addicted Member
Re: Regular expressions
VB Code:
Dim tbox As TextBox = DirectCast(sender, TextBox)
If Regex.IsMatch(tbox.Text, "^([a-zA-Z]+)/([0-9]{2,2})$") = True Then
Else
MsgBox("Not valid String")
End If
i assumed that the first part of the string contains only char not num
-
May 6th, 2005, 03:43 AM
#3
Thread Starter
Frenzied Member
Re: Regular expressions
Modified it slightly its working now
VB Code:
Dim tbox As TextBox = DirectCast(sender, TextBox)
If Regex.IsMatch(tbox.Text, "^([a-zA-Z0-9.]+)/([0-9]{2,2})$") = True Then
Else
MsgBox("Not valid String")
End If
Thanks
Jorge
"The dark side clouds everything. Impossible to see the future is."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|