Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to escape the ' delimiter to add it to a REGEX pattern in SQL

I added a REGEX pattern to Talend to check for valid alpha only names, I got the pattern correct except I need to add the ' character as a valid name could be O'Brian. The only issue is that that character is used to enclose the pattern in the SQL statement and if I add it causes a syntax error. Would appreciate it if someone could tell me how to include the character to the below. Thank you in advance!
[size=2][font=Verdana, sans-serif]SELECT "LASTNAME" FROM "CAIDAN"."MEMBERMASTER"  WHERE (  NOT REGEXP_LIKE("LASTNAME" , '^[a-zA-Z .-]+$' )  OR "LASTNAME" IS NULL )[/font][/size]
Labels (2)
2 Replies
Sebastiao_Qlik
Employee
Employee

Hi Keyth,
did you try to add \ before the ' character?
Anonymous
Not applicable
Author

Yes, tried that and it seemed to cause a syntax error. I also noticed that a name like O'Brian in the test window also caused an error? It someone at Talend could take the REGEX posted and try it in Talend with a test name like O'Brian you should get the same error.