You are viewing limited content. For full access, please sign in.

Question

Question

Pattern Matching

asked on August 14, 2018

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   

0 0

Replies

replied on August 14, 2018

Figured it out

1 0
replied on August 15, 2018

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.  :-)

0 0
replied on August 15, 2018

I'm using the pattern (\w+) would you recommend a different solution?

0 0
replied on August 15, 2018

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

0 0
replied on August 15, 2018

Thanks for the tip. I use to have a link that gave me some good information to define these pattern matching, lost it and have been unable to find it. Is there a good site out there that can help with this?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.