Hi Guys,
I'm wondering can Reg Ex tool be used (Without Text to columns) in order to extract the first alphabetical charater in a string when reading from left to right
12874-0001BDUSDXXXXXXXXX
For example above it would be "D" - Going from left to right
Thanks 🙂
Solved! Go to Solution.
Sorry that should be "B" above
Here is a workflow for the task.
Regextool config:
Output:
Hope this helps 🙂
If this post helps you please mark it as solution. And give a like if you dont mind 😀👍
Worked a dream - Thank You !!!!! 🙂 - Can you explain to me whats happening with the Reg ex tool here - What does tokenise mean ?
[[:alpha:]] is regex for alphabet character. By setting to tokenize it gets all the alphabetical character splitting them into columns depending on the numbers of columns set. Since i have set 1 it just showing one character column.
Hope this helps🙂
Stupied question - Why doesnt it keep other alpha characters in the string ? (I dont want them just wondering)
So just [[:alpha:]] is single character [[:alpha:]]+ is one or more. So + and * are used to catch more characters. Click on the option highlighted it will give you a list.
This link gives more idea on the usage
https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/RegEx-Perl-Syntax-Guide/ta-p/1288
Hope this helps 🙂
Left to right it should be "B"....
left(trimleft([Field1],"0123456789-"),1)
This formula returns B. It can be modified to read right to left too (unlike RegEx). It also runs faster than RegEx.
Cheers,
Mark
Is it posible to use this regex in a formulae tool - For example I have 6 different data types - Only if it is equal to data type '3' do I want the reg ex to execute
Yes it is possible. Depending on the requirement.
Can you please me a sample data, expect output and explain the logic.
Will be happy to help 🙂