• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

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||':',
			    and status_id = nvl(l_status_filter,1)
			  order by 1)

Open in new window

BILL Carlisle
BILL Carlisle
  • 2
1 Solution
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...


if the only thing you're trying to do is an existence check of some substring  "like" or "instr" might be better, even with an UPPER to handle your case insenstive searching

and instr(upper(group_name), upper(nvl(l_search,group_name))) > 0

regexp are fairly expensive compared to other string functions. Unless your string parsing is complex enough to warrant the cost of regular expressions, I'd avoid them.
BILL CarlisleAPEX DeveloperAuthor Commented:
Thank you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now