Regular Expressions 101

Library entries

overly complicated postal code regex

Vote

0

Regular Expression
python

"
^((\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

Loading markdown...
Submitted by anonymous - a year ago