Hello, I'm trying to find special characters in the field using Regex_Match. I need to check double and single quotes as well, but I can't figure out the format to include them.
Here's my formula:
REGEX_Match([ALL], ".*[\@!#%^*?$~+&].*")
This is what I want:
REGEX_Match([ALL], ".*[\@!#%^*?$~+&"'].*") i.e. add checks for " and ' as well.
I tried using """ for " as well as ' " ' and many other combinations, but nothing works.
Please help :)
Solved! Go to Solution.
how about something like:
REGEX_Match([ALL], ".*[\'\@!#%\^\*\?\$~\+\&].*") OR REGEX_Match([ALL], '.*["\\@!#%\^\*\?\$~\+\&].*')
You origina logic needs to mark off other special characters--- if you have a universe of characters you do want - maybe you can use [] to include them and a ! sign?
I just realized that I can actually include a single quote similar to other characters, but I'm still struggling with the double quotes.
see my suggestion. use an OR statement so ---- ' in your first statement - add an
OR regex_match([field],'"') to your formula.
There are other ways - but this is the most straightforward. you have ' in your doublequote term and double quotes in a standalone single quote term.
This worked, thank you!
Cool - can you mark my suggestion as a solution?
@Kaisa77 if you want to include both, then you just need to concatenate 2 strings, so:
REGEX_Match([ALL], ".*[\@!#%^*?$~+&'"+'"'+"].*")
Where I put the single quote in the first string (enclosed by double quotes), then concatenate a double quote string (enclosed in single quotes), then concatenate the rest of the formula (enclosed in double quotes).
Hope that helps,
Ollie
I'm sorry, I thought it worked, but then I ran on the full set and it didn't work :(
This solution definitely worked, but to avoid rerunning everything I only separated " and ' checks like this:
REGEX_Match([ALL], ".*[\'"+'"'+"].*")
and it worked, but I can't figure out how to ONLY check the double-quotes.
Could you please help me with that too? :)
only check for double quotes? regex_match([field],'.*".*') would flag anything with at least one "