Split alphanumeric string using Regex
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Noob_1-800
5 - Atom
‎05-20-2023
02:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi -
I have a dataset with the following column
ABCD1234
ABCDE1345
ABCDEX2345
The alpabets can vary, but the numeric length is always 4 character
Labels:
- Labels:
- Regex
2 REPLIES 2
binuacs
21 - Polaris
‎05-20-2023
02:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
15 - Aurora
‎05-20-2023
02:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If the numeric length is always 4 characters, you don't need to use RegEx function.
Here are two ways. (As RegEx requires more resources in general, I would recommend another option.)
Using RegEx
NumericData = REGEX_Replace([Data], "[a-zA-Z]+", "")
AlphabeticData = REGEX_Replace([Data], "\d+", "")
Without RegEx
NumericData = Right([Data], 4)
AlphabeticData = Substring([Data],0,Length([Data])-4)
Output
