Quantcast
Channel: User Ciprian Tarta - Stack Overflow
Viewing all articles
Browse latest Browse all 31

Answer by Ciprian Tarta for Django URL Regex for an "Address"

$
0
0
r'(?<address>^\d{1,5}\s[a-zA-z\s]+,\s[a-zA-z]+,\s[A-Z]{,2}$)'

This is about as strict as it gets.

Basically what it does is:

  • makes sure it starts with a number

  • makes sure the the number is max 5 digits long(not sure who long this can go to, adjust{1,5} if needed

  • makes sure comma, space and street name follows

  • makes sure comma, space and city name follows

  • makes sure comma, state follows and it ends with state


Viewing all articles
Browse latest Browse all 31

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>