In your regex:
^\d{1,5}.*[^0-9][0-9]{5}$
And an example text:
123 King Drive 12 OH 12345
-
^ \ d {1,5} matches "123"
. * corresponds to "King Drive 12 OH"
[^ 0-9] matches ""
[0-9] {5} $ matches "12345"
Like others, they suggested that this could have avoided this problem, since you are explicitly saying (as opposed to using ". *") So as not to correspond to any signs in the middle of the line:
^\d{1,5}\D+\d{5}$
source share