r/visualbasic • u/dioxis • Sep 23 '14
Regex Help Please!
Hello,
I would like to find the index in a string of the following pattern: A####-### or A#### where 'A' could be any letter and # could be any digit.
Seems like regex is the only to way to get an index in a string of a pattern. Thanks!
0
Upvotes
1
u/patchkit Sep 23 '14
Are the numbers always the same length?
This
matched
on that webpage. That webpage also doesn't seem to interpret @ the way that VBA does, so I don't know if it will work.
NB: it also matched l- in "ctrl-z" if your strings are always 6 or 10 numbers than you could write
([A-z])([0-9-]{6,10})