Go Home
WELCOME TO THE PLAYGROUND
Regular Expressions:)
Public Sub regexchecker()
Dim userName As String = "1234567899"
userName = Regex.Replace(userName, "(\d{5})(\d{1})(\d{4})", "($3)")
'output is (7899)_6-(12345)
Dim mtch As Boolean = Regex.IsMatch("a22x", "^[a-zA-Z]\w{3,14}$")
'if first chatacter is a letter and 4
Dim [string] As String = "29.5.2003 d::x 00:00 am"
' Dim xmonth As String = Regex.Replace([string], "(\d{2})(\d{2})(\d{8})", "$2")
'----------- [string] = Regex.Replace([string], "([\.\:\' 'a-zA-Z])", "")
'[string] = [string].Replace(".", "").Replace(":", "").Replace(" ", "")
Dim omth() As String = Regex.Split([string], "([\.\' '])")
Dim i As Integer
Dim oxmth As String
For i = 0 To omth.Length - 1
oxmth = omth(i)
If oxmth.Length < 2 Then
oxmth = "0" & oxmth
End If
Next
Dim month As String = Regex.Replace([string], "(\d{2})(\d{2})(\d{8})", "$2")
'month = rx.Replace([month], "([a-zA-Z])", "")
End Sub