REGEX PARSE PROBLEM
- 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'm trying to parse an 8-digit string that has "2" in the first and fourth position from a larger string. I used Regex Pal to get this:
[2]\d{3}[2]\d{3}
but it does not work in Alteryx Regex. What do I need to change?
Thanks,
Ben
Solved! Go to Solution.
- Labels:
- Preparation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I believe what you want to do is create marked groups, so something like this:
([2])(\d{2})([2])(\d{4})
If the second # 2 is in the 4th position, then you'll only want 2 digits between the first instance and the second, not 3 as indicated in your RegEx Pal string.
Does this accomplish what you're looking for? Kindly mark solved if so, or let me know if additional tweaking is needed! Thanks!
NJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Try without the brackets:
2\d{3}2\d{3}
Here is what I got:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Scratch my first response. Looking at @Joe_Mako response and then re-reading your original question, I think this might be the combination you're looking for - a parse though, not a match, and for it to pull out just the string of 8 digits from the larger string regardless of their location in the string. Getting closer? :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @kpmg_lc_analyst
Did the solutions below get you to a working outcome?
If so - would you mind marking this as solved - or if not then let's work together to iterate to a solution that works?
thank you!
Sean
