I am trying to validate an English postcode of the form XXXX XXX using regular expressions.
I think I may have something wrong with my pattern. I am new to regular expressions and would appreciate if somebody could point out any glaring errors.
I think I may have something wrong with my pattern. I am new to regular expressions and would appreciate if somebody could point out any glaring errors.
Visual Basic:
Dim pattern As String = "^\s*(\d{4}\s+\d{3})\s*$"
If Not Regex.IsMatch(txtPC.Text, pattern) Then
' Do Stuff
End If
[\VB]
Thanks in advance.