Home » SQL & PL/SQL » SQL & PL/SQL » REGEXP_LIKE (12c ENT Edition 12.2.0.1.0)
icon1.gif  REGEXP_LIKE [message #684974] Mon, 04 October 2021 04:16 Go to next message
vippysharma
Messages: 64
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. Sad

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 Go to previous messageGo to next message
Michel Cadot
Messages: 68043
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

Re: REGEXP_LIKE [message #684979 is a reply to message #684978] Mon, 04 October 2021 06:27 Go to previous message
vippysharma
Messages: 64
Registered: May 2013
Location: www
Member
Thanks !!
Previous Topic: SQL Query- Connect By (merged)
Next Topic: Retrieve font name available in OS using sql plus
Goto Forum:
  


Current Time: Thu Dec 02 14:01:37 CST 2021