Hello All,
Odd request this and my regex is failing me. I need to take a column and basically have the text string have as many " " as it does letters. (Appreciating this will be an empty field full of dynamic spaces depending on cell string length).
I did try REGEX_Replace([My data],"\.", " ") but I still get the text, What's the correct regex?
Thank you
Data:
My Data | Length of String |
To Check | 8 |
My Birthday | 11 |
Happy Birthday | 14 |
Solved! Go to Solution.
Hey @Bobbins,
😄 that is an odd use case! You dont need the backslash as that escapes the special character. What you want is this:
REGEX_Replace([My Data], ".", " ")
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
@Bobbins you just need to remove the \ where you have \. as your target. Escaping it with the backslash means Alteryx is looking for fullstops, whereas a . on it's own indicates any character:
@IraWatt @DataNath Ah doh. Thank you both! I was using Regex101 and it has a / to start.
So unusual eh? I need this because I have a graph which I need the Y axis which is full of names to look like this:
Bob - Birthday
Jane
Tom
Tammy - Happy New Year
Logan
Paul
Jane, Tom, Logan and Paul all have the same as Bob or Tammy (relative) but it looks messy if they all say it, so I can just manipulate the text field to have a large gap for them and all looks better.
Odd i know!
@MarqueeCrew I didn't even know about this function, thats so much quicker (and easier!). Thank you!!