We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Oracle RegExp to Find String

bobcaputo
bobcaputo asked
on
Medium Priority
851 Views
Last Modified: 2012-05-11
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
Comment
Watch Question

Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012

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

this will find any dash surrounded by non-dashes
Database Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
Thank you, now that I see it, it is much clearer and obvious!!!!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.