Field1 is the input in below snip:
I have encircled the output
I want the output using Regex_replace(String,Pattern,Replace) function.
Basically I want 2 characters that lie on the either side of the backslash "/" along with the backlash
Hey @Chirag_KRCPL,
There is definitely a cleaner regex formula then this but here is one way:
Essentially it uses three parts:
match any non space character
[^\s]+
match a space character
\s
match a forward slash
\/
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
Hi @Chirag_KRCPL,
You could use the following piece of Regex to extract it, the $1 essentially calls the first capture group. Therefore overwriting the entire text string with just what is contained in the capture group.
REGEX_Replace([Field1], '.*(\S+\s+\S+\s+\/\s+\S+\s+\S+).*$', '$1')
I've attached an updated workflow!
Kind regards,
Jonathan
@IraWatt I took a similar approach to you, but using \S rather than [^\s] to call non whitespace characters 😎
@Jonathan-Sherman of course ! 😅 always forget \S is a thing...
Hi @Chirag_KRCPL ,
Find attached a way to do that with regex_replace function.
Let me know if there is any issue.