Link to home
Start Free TrialLog in
Avatar of William Peck
William PeckFlag for United States of America

asked on

Need help with Oracle Regexp_substr

Need an Oracle Regular Expression to pull out FRENCH from this pattern

RECEIVED A LANGUAGE STUDY MINOR IN FRENCH, which is embedded in this sample string. Assume the string ends in a period(.)


Sample full string.

ATTENDED UGA 1ST SEM/FALL 1997-98 AS AN EXCHANGE STUDENT.
RECEIVED A LANGUAGE STUDY MINOR IN FRENCH. CAPSTONE SCHOLAR PROJECT - 'THE EFFECTS OF FIBER REINFORCED PLASTIC COMPOSITES ON THE DUCTILITY OF RETROFITTED CONCRETE BEAMS'


I tried but can't follow the REGEXP_SUBSTR pages such as this - it's all too cryptic to me, and I hardly use this.







Avatar of Sean Stuber
Sean Stuber

what is the rule for determining that substring?

It appears that you're looking for the string 'FRENCH.'.

If so, the LIKE predicate is fine

WHERE text LIKE '%FRENCH.%'


EDIT:  Sorry -- looked at this backwards.  :)
Assuming you want the 2nd line ending in a period, try this...

select regexp_substr(yourcolumn,'^[^.]+\.',1,2,'m') from yourtable

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 William Peck

ASKER

@Kent Olsen - you remind me again I need to make my questions a little more clear ... I got the %wild card part, Sean finally figured out what I really meant ... but thank you.

@Sean Stuber - yes on # 2 - - - you figured out what I was trying to say ... and whoa - that worked!!!!! I would have never figured that out from the tech page, Thank you!!!
@Sean - you've helped me many times over the past 17 years - wow. One in particular was an Oracle analytic function from way back, and then 7 years later I needed to get the syntax again, and I was able to do a google search and found the original EE post ... thx!