The data is as follows (here the date is in string datatype):
31/December/2022
31/Dec/2022
December/31/2022
Dec/31/2022
Requirement - I want to extract the name of the month from this string using regex and want to count the length of the resultant string.
Kindly help me with the solution.
Regards,
Chirag
Solved! Go to Solution.
@Chirag_KRCPL how does something like this look? The first expression just replaces all non-letters with nothing to strip out numbers/punctuation. The second expression then brings back the length of this resulting extract:
Hey @Chirag_KRCPL,
Here is one way of doing this:
I use the regex tool with the pattern:
([[:alpha:]]+)
This extracts just the months with your sample data set.
Then I use the length function to get the length of the strings.
If you want to learn more about Regex the community has some really quick interactive videos on getting to grips with it here https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Parsing%20...
Any questions or issues please ask
Ira Watt
Technical Consultant
Watt@Bulien.com
User | Count |
---|---|
19 | |
15 | |
13 | |
9 | |
8 |