Link to home
Start Free TrialLog in
Avatar of bobcaputo
bobcaputo

asked on

Oracle RegExp to Find String

Hello,

I am looking for a regexp in Oracle sql to find the following conditions.

(char)-(space)
or
(space)-(char)

The middle character is a - (dash). Basically I want any rows that have a dash with a character, including space, next to the dash on either side.

Thank you,

Bob
Avatar of Sean Stuber
Sean Stuber

select * from yourtable
where regexp_like(yourstring,'[^-]-[^-] ')

this will find any dash surrounded by non-dashes
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 bobcaputo

ASKER

Thank you, now that I see it, it is much clearer and obvious!!!!