regex - Regular expression for street address? -
this question has answer here:
- regular expression street address 3 answers
i need regular expression street address example:
test 123 - valid 123 test -not valid
so need letters(required) space , number(required) tried without success
@"^[a-za-z ][0-9 ]"
you need include quantifiers, anchors.
@"^[a-za-z]+ [0-9]+$"
+
repeats previous token 1 or more times.
you may use if space optional.
@"^[a-za-z]+ ?[0-9]+$"
Comments
Post a Comment