regex help - match all alpha characters until numbers
- 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
Hi,
I have some data like the following:
Abcd Efgh 1111
Abcd - Lmno
What I would like to get is just Abcd Efgh from the first row (get rid of all following numbers), and
keep Abcd - Lmno
is regex the best way to do this? I tried a formula, but unfortunately, got all False
thanks.
Solved! Go to Solution.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @hamzam
I would probably go a RegEx route with this one, although you could also use the Data Cleansing tool to remove all numbers.
Regex Replace will help you replace the numbers with nothing. If in a formula, you can use: Regex_Replace([Field],"(.*?)(\d*.*)","$1"). This marks everything before a number, and then after a number as distinct groups and replaces with just what's before the number.
Let me know if that helps. Cheers!
Esther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@mceleavey 's solution is also elegant. You could use the Replace method in the RegEx tool as well. My method uses a formula tool.
I'd go parse if the numbers are important to keep, and Replace if you want to drop them.
Cheers,
Esther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
thank you both @mceleavey and @estherb47
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You're very welcome, @hamzam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You're welcome!!!
