Extract Alpha Numeric String
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
That works great, thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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))
