Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
oftenwrong
· 11y ago · 0 comments
In many environments,
[0-9]{3}-?[0-9]{4}
is even more specific (and faster) because \d would match other digit characters outside of [0-9].
Comments
[–]
dalore
11y ago
taking it to the next level:
[0-9][0-9][0-9]-?[0-9][0-9][0-9][0-9]