Hello,
I'm new to Alteryx and slowly developing my skillset. I'm trying to extract year information from text (for example "XXX - Year 2020" and "XXX - Year 2020-2022") to a new column. I'm trying out the RegEx function and want to write something that helps put information after "-" or word "year" into a new column, but having some trouble entering the correct regular expression. Any solution or suggestions would be much appreciated!
Solved! Go to Solution.
Hey @iteng,
This regex will get anything after a -
-(.*)
This regex will get anything after year
year(.*)
If you wanted to identify any 4 digits use this
\d{4}
For this problem I would use something like
year ([\d-]+)
Check out regex101: build, test, and debug regex to learn more about and test regex.
Any questions or issues please ask :)
HTH!
Ira
This is super helpful. Thank you so much for your help!
@iteng
You will love the regex once you get to know it a bit more like me. 😁
@IraWatt gives good details which I really love it.
I would like to introduce a few links from the Knowledges Database, in case you have not noticed.
https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-RegEx/ta-p/37689
Thanks @Qiu ! 😄 Completely agree once you start using Regex its actually quite good fun 😅
User | Count |
---|---|
107 | |
82 | |
69 | |
54 | |
40 |