SOLVED
Regex Help - Expression not giving the results expected
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
keith_ainsworth
6 - Meteoroid
‎04-23-2015
04:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have a string that may contain the values: 1,2,3,4,5,6,7,888,981 or any permutation of those 9 values. I am using RegEx with Parse output option with the following expression - ^(1)|(2)|(3)|(4)|(5)|(6)|(7)|(888)|(981)$.
Example - Field value = 2,4,981
When I use the expression above and parse the capture groups into their own buckets I only get the first match and all the other buckets have whitespace (Not null). I expected to see the values in the 2nd, 4th, and 9th bucket respectively. RegEx Buddy gives me the expected results (using a RegEx format of Perl 5.2.0). What am I doing wrong?
Example - Field value = 2,4,981
When I use the expression above and parse the capture groups into their own buckets I only get the first match and all the other buckets have whitespace (Not null). I expected to see the values in the 2nd, 4th, and 9th bucket respectively. RegEx Buddy gives me the expected results (using a RegEx format of Perl 5.2.0). What am I doing wrong?
Solved! Go to Solution.
Labels:
- Labels:
- Regex
1 REPLY 1
‎04-25-2015
04:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Big Kudos go out to Gene Rinas for his elegant solution to this problem. Was able to bypass RegEx completely!
By using "Text to Columns" then adding a "counter" field with a value of one. A cross tab with a group on the recordID, the response as the header field and count as the data field gave me EXACTLY what I was looking for.
