Rather new to pattern matching, looking for the right formula that would give me all numbers before a -
example would be:
retrieved field: 66589-23-01 pattern match would return: 66589
Rather new to pattern matching, looking for the right formula that would give me all numbers before a -
example would be:
retrieved field: 66589-23-01 pattern match would return: 66589
Figured it out
just to give you a tip... if your number is going to contain those dashes, I would definitely incorporate that in your pattern and not just pick the first 5 digits. i mean, i don't know your source but it it is a body of text then i would definitely be much more specific.
happy PMing. :-)
I'm using the pattern (\w+) would you recommend a different solution?
I would probably recommend (\d+) instead unless you want to return more than just numbers
\d represents a decimal digit (0-9)
\w represents a word character (letters, numbers, and connecting punctuation) See Word Character: \w