I am trying to extract out a sting from text body that is a string of 2 letters followed by 8 numbers. Not sure how to go about doing this i.e. I want to find strings like AB12345678. Not sure if this is Regex or string function.
Thanks
Solved! Go to Solution.
regex_replace([String],".*?([a-zA-Z]{2}\d{8}).*",'$1')
That will get you the first occurrence of what you're looking for. So something like mark Ab12345678 adam Ar12345678 will return: Ab12345678.
You can use that formula in a formula tool :)
If multiple values can exist, I would use the RegEx tool and configure it with the expression:
([a-zA-Z]{2}\d{8})
Then set the output method to Tokenize.
You can either output to Rows or Columns and get all values.
Cheers,
Mark
That works great, thank you!
I have a similar situation where i have a vstring alphnumeric field. Need to parse the first 2 letters from the numeric portion. There are no delimiters. I tried trimright but it isn't working. Most of the data set falls into the following format XX12345 or XX123456. For any that don't fall into that format i would want to filter out.
Appreciate any suggestions you may offer. thank you
never fails - i post and then figure it out.
For anyone else looking to do this, this is the formula I used
trim([string],Right([string],5)) and trim([string],Right([string],6))