Hello,
I'm brand new to Alteryx, and pretty new at analyzing/manipulating data.
I'm trying my hand at using RegEx to parse some county jurisdictions. My challenge is some of my data has just one word, some two, and some have three, etc. I tried to make a regex expression to capture all the scenarios, but jurisdictions that are just one word are still returning false and populating null. My example is below. Could anyone assist with where my expression is failing?
Here is what I came up with so far, using RegEx
((?:^\w+)|(?:^.*)|(?:\<\w+\>))\s(\w+)
Results | |||
Jurisdiction | RegEX 1 | RegEx 2 | |
Anchorage | null | null | not ok |
Los Angeles | Los | Angeles | ok |
St. Lucie County | St. Lucie | County | ok |
Thanks!
Solved! Go to Solution.
Hi @Rosaile,
when using the "|" in regex it effectively creates a marked group (or...) and so I simply created another which will kick in it it fails to meet the criteria of the other.
I set up the regex parser as such:
Which gives you the following:
which you can then manipulate accordingly.
Hope this helps.
M.
Thank you! That is exactly what I wanted.