Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Regex_Replace Question

toryjane
5 - Atom

Hi everyone,

 

I am trying to replace something like "macOS (13.6.5)" to be "macOS 13". When I use: REGEX_Replace([Column Name], "(13\....)","13") I get "(13)". Thoughts?

2 REPLIES 2
SPetrie
12 - Quasar

Someone can probably make a better patter, but try this regex instead.

REGEX_Replace([Column Name],"\((\d+)\..+\)", "$1")regex.JPG

parenthesis are used in creating capture groups, so they are being ignored in your pattern. escaping them will include them in the pattern. I still use them to capture the beginning digits of the pattern and use it as the replace with the $1, that way you dont have to hard code the actual number.

toryjane
5 - Atom

Exactly what I needed. Thank YOU!

Labels