Link to home
Start Free TrialLog in
Avatar of BILL Carlisle
BILL CarlisleFlag for United States of America

asked on

REGEXP_LIKE ?? Should I use

I have been using the below code to do a key down filter using ajax but now I realize the regexp_like is not seeing the ( and ) as normal characters.
Should I be using this regexp_like here?
select group_name, group_id, rownum r from ( 
			 select group_name, group_id
			   from um_groups
			  where group_type_id = 2
			    and regexp_like( group_name,
				   nvl(l_search,group_name), 'i' )
			    and nvl(instr(':'||l_selected||':',
					 ':'||group_id||':'),0)=0 
			    and status_id = nvl(l_status_filter,1)
			  order by 1)

Open in new window

Avatar of Sean Stuber
Sean Stuber

if "l_search"  is a string like  this


'(something)'     the ()  are regular expression delimiters to identify "something" as pattern.

if you want to search for the parentheses characters themselves.  you must prefix them with "\"

try modifying l_search like this...

replace(replace(l_search,'(','\('),')','\')
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BILL Carlisle

ASKER

Thank you!