Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Regex Rookie- Match other than indicated

Afammy
7 - Meteor

I'm studying regex and I think this should work, but alteryx is telling me the match is 'False'. I'm trying to match any rows that contains non alpha, non digit, non ".", non "%", non "/"- in other words- these are ok but want to remove all else (I'll do the parse function after I can find and validate through match). 

 

[^A-Za-z0-9\.\%\/*]

 

Shouldn't this work? Thanks ahead of time.

6 REPLIES 6
Philip
12 - Quasar

Can you provide the test data set?

jgo
Alteryx Alumni (Retired)

The asterisk at the end might be throwing something off... escape it if you're actually telling it to also look for that character since it's used as a specifier, but I think the reason why it's not finding a match is because that expression is only looking for a 1 character value. You need to create an expression that would evaluate the entire value. Using your expression and adding ".*" to the start and end, this is now saying that between any amount of characters that may or may not exist, look for anything that is NOT <your expression>.

 

.*[^A-Za-z0-9\.\%\/*].*

Also, a simplified expression would be 

.*[^\w\.\%\/].*

 


Afammy
7 - Meteor

Doesn't seem to work as it provides all True if I add wildcard only to beginning and all False if add to both beginning and end. Not every line of my text meets the criteria. I'm surprised there's not a regex tool created that will act as a wizard to help build the regex- "remove: .,%" etc. 

 

Thanks for the help- much appreciated. 

Afammy
7 - Meteor

Philip, I'd like to share the actual dataset, but it's considered confidential. I know that makes this harder for those of you trying to help. Essentially, how would I strip out or replace the # symbol from this string without specifically calling out the # since I don't know what other characters may exist in the file that I may want to remove? Hope this helps. 

 

Aaaaa bbbbb123, a2%#Aaaaa bbbbb123, a2%

jgo
Alteryx Alumni (Retired)

@Afammy,

 

Take a look at the attached workflow, specifically on the Formula tool.

 

Two examples to see if you want to simply be told if there's a match and another that replaces matched characters with nothing.

Afammy
7 - Meteor

Thanks Jgo. 

Labels