1

I have a table in an Oracle 11g database with a column named REPORT. I'm trying to write a select statement that would display the required results below. I need to select the character string between the "\" and the following occurrence of "#". I thought this could be accomplished using the regexp_substr function, but I haven't had any success. I have too many examples of my unsuccessful attempts over the last week to post here. Any help would be appreciated.

REPORT_COLUMN

#Med Reports\Client, Ray.dco#
Financial Reports\Client, Justin-1.dco#Financial Reports/Client, Justin-1.dco#
#Med Reports\Client, Jessy.dco#
Financial Reports\Client, Channa-1.dco#Financial Reports/Client, Charnisha-1.dco#

Required results:

Client, Ray.dco
Client, Justin-1.dco
Client, Jessy.dco
Client, Channa-1.dco
Jayce Glen
  • 49
  • 4

1 Answers1

0
select regexp_substr(REPORT_COLUMN,'\\(.*?)#',1,1,'',1)
  from Table
Mike
  • 1,985
  • 1
  • 8
  • 14
  • Thank you. That works perfectly. I admit I don't completely understand it yet. I guess I need to study up on regexp_substr. – Jayce Glen Nov 18 '17 at 08:30