Regular Expressions 101

Community Patterns

overly complicated postal code regex

0

Regular Expression
Python

r"
^((\d)(\d)((?!\2)\d)((?!\3)\d)(?!\4)(?!\5)|(\d)(\d)((?=\6)\d)((?!\7)\d)((?!\8)\d)(?!\9)|(\d)(\d)((?!\11)\d)((?=\12)\d)((?!\13)\d)(?!\14)|(\d)(\d)((?!\16)\d)((?!\17)\d)((?=\18)\d)(?!\19)|(\d)(\d)((?!\21)\d)((?!\22)\d)((?!\23)\d)(?=\24))
"
gm

Description

no description available

Submitted by anonymous - 3 years ago