Toggle navigation
Regex DB
Search
Notice: This site is currently in beta. It may break at any time, and all URLs are subject to change.
Postal Code > UK (simple)
Favorite
British Postal Code Schema, simpler version
Test with sample data
Normal
Quoted
/^([A-Z]{1,2}\d{1,2}[A-Z]?)(\d[A-Z]{2})$/i
'/^([A-Z]{1,2}\\d{1,2}[A-Z]?)(\\d[A-Z]{2})$/i'
See Also
Postal Code > UK
Sample Matches
Text
Result
A19XY
Group #0
A19XY
Group #1
A1
Group #2
9XY
match
AB19XY
Group #0
AB19XY
Group #1
AB1
Group #2
9XY
match
A129XY
Group #0
A129XY
Group #1
A12
Group #2
9XY
match
AB129XY
Group #0
AB129XY
Group #1
AB12
Group #2
9XY
match
A1Z9XY
Group #0
A1Z9XY
Group #1
A1Z
Group #2
9XY
match
AB1Z9XY
Group #0
AB1Z9XY
Group #1
AB1Z
Group #2
9XY
match
A12Z9XY
Group #0
A12Z9XY
Group #1
A12Z
Group #2
9XY
match
AB12Z9XY
Group #0
AB12Z9XY
Group #1
AB12Z
Group #2
9XY
match
Categories
[No Folder]
Base64 encoded string (RFC 4648)
Copyright year
Copyright year (html)
CSV
Dice roll spec
Identifier (in C-like programming languages)
LDAP query
SemVer
Vehicle Identification Number (VIN)
Boolean
Boolean value
False value
True value
Credit Card
American Express (advanced)
American Express (simple)
Discover (advanced)
Discover (simple)
MasterCard (advanced)
MasterCard (simple)
Visa (advanced)
Visa (simple)
CSS
CSS class
Hex color
Hex color (6 digit)
hsl()
hsla()
rgb()
rgba()
DateTime
Date MMDDYYY
Date with optional time (ISO 8601)
Date YYYYMMDD
Day of week
Duration (ISO 8601) - Find
Duration (ISO 8601) - Validate
Leap year
Name of month
Repeating interval (ISO 8601) (R<n>/<start>/<duration>)
Time
Time (00-24)
Time (h:m:s)
Email
Email address (advanced)
Email address (Blink/Chrome)
Email address (Gecko/Firefox)
Email address (PHP)
Email address (RFC 822)
Email address (simple)
Email address (Webkit/Safari)
Email address list
HTML5
Character entity reference
Duration (1d 2m ...)
Duration (ISO 8601)
Global date/time
Local date/time
Month
Time
Timezone offset
Week
Yearless date
ID
ISBN-10
ISBN-13
MAC address (advanced)
MAC address (simple)
SSN (loose)
SSN (strict)
UUID/GUID
UUID/GUID with optional braces
Number
Dollar value
File Size
Floating point
Floating point with exponent
Integer (loose, commas not allowed)
Integer (strict, commas allowed)
Natural number
Real number
Roman numeral
Whole number
Phone
Phone number
Phone number (7+ digits)
Postal Code
Australia
Australia (simple)
Belgium
Brazil
Canada
Canada (simple)
Denmark
France
Germany
Greenland
Italy
Netherlands
Netherlands (simple)
Norway
Spain
Switzerland
UK
UK (simple)
(current)
USA
Quoted String
'Single quotes' with backslash escape
'Single quotes' with quote escape
'Single' or "double" quotes with backslash escape
"Double quotes" with backslash escape
"Double quotes" with quote escape
String
Invalid UTF-8 character
Valid UTF-8 string
URL
IPv4 (RFC 3986)
IPv4 (simple)
IPv6 (RFC 2732) v1
IPv6 (RFC 2732) v2
URL encoded string
Valid URL (RFC 3986)
Valid URL (RFC 3986) (Advanced)