REGEXP_LIKE [message #684974] |
Mon, 04 October 2021 04:16  |
 |
vippysharma
Messages: 73 Registered: May 2013 Location: www
|
Member |
|
|
Hi All,
I stuck with one problem today, related to REGEXP_LIKE...
Tried googling and did some experiments too but all in vain.
How can we make REGEXP_LIKE to treat "(string)" as a sperate identity ? Means, if I have any special character in my string (let's say we have brackets in my string) then REGEXP_LIKE should treat that with string, for example...
-- Checking Suffix with no Special character(s)
SELECT * FROM DUAL WHERE REGEXP_LIKE ('ABC PVT LTD','(INC|LTD|PBL)$','i'); -- This is working fine
O/P - X
-- Checking Suffix with Special character(s)
SELECT * FROM DUAL WHERE REGEXP_LIKE ('ABC PVT (LTD)','(INC|(LTD)|PBL)$','i'); -- This is not working fine
O/P - (nothing)
thanks,
|
|
|
Re: REGEXP_LIKE [message #684978 is a reply to message #684974] |
Mon, 04 October 2021 04:24   |
 |
Michel Cadot
Messages: 68417 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
I don't understand what you want but if your problem is with parentheses in the string, then you have to escape them in the search string:
SQL> SELECT * FROM DUAL WHERE REGEXP_LIKE ('ABC PVT (LTD)','(INC|\(LTD\)|PBL)$','i');
D
-
X
[Updated on: Mon, 04 October 2021 04:25] Report message to a moderator
|
|
|
|