Home » SQL & PL/SQL » SQL & PL/SQL » Extracting specific portion of a string using REGEX (Oracle Database 11g Enterprise Edition Release 11.2.0.4.0, Windows 10 Professiona)
Extracting specific portion of a string using REGEX [message #679840] Mon, 06 April 2020 11:03 Go to next message
buggleboy007
Messages: 261
Registered: November 2010
Location: Canada
Senior Member
I have a string(or two records) of the type:
a) C:\Users\user1\Pictures\1.JPG
b) C:\Users\user1\Pictures\file_example_TIFF_1MB.tiff
I am using the following query to extract the name of the file and I am only able to pull the 1st record out (1.JPG). How can I pull both - first and second (1.jpg and file_example_TIFF_1MB.tiff) including any file extension (whether upper or lower case).

When I use this:
select dt, seq, message,REGEXP_SUBSTR(message,  '[0-9]+(.JPG|.TIFF|.tiff)+')
from log_output_table where seq in (23438852,23438853);  
Output is only : 1.JPG

When I use this:
select dt, seq, message,REGEXP_SUBSTR(message,  '[[:alnum:]]+(.JPG|.TIFF|.tiff)+')
from log_output_table where seq in (23438852,23438853);  
Output is:
1.JPG
example_TIFF

Can anyone help me out? Thanks in advance.
Re: Extracting specific portion of a string using REGEX [message #679841 is a reply to message #679840] Mon, 06 April 2020 11:46 Go to previous messageGo to next message
buggleboy007
Messages: 261
Registered: November 2010
Location: Canada
Senior Member
This issue has been addressed i.e. it has been answered in OTN.
Thanks in advance for any one looking into this.
Re: Extracting specific portion of a string using REGEX [message #679843 is a reply to message #679841] Mon, 06 April 2020 13:47 Go to previous messageGo to next message
Michel Cadot
Messages: 67370
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Solution? Link?

Re: Extracting specific portion of a string using REGEX [message #680070 is a reply to message #679843] Mon, 20 April 2020 17:31 Go to previous message
buggleboy007
Messages: 261
Registered: November 2010
Location: Canada
Senior Member
Here it is: https://community.oracle.com/thread/4324241

Sorry for the late reply.
Previous Topic: PL/SQL Stored Procedure Showing Oracle Error 27476 (Job Doesn't Exist)
Next Topic: Emp Code Searching Issue
Goto Forum:
  


Current Time: Mon Sep 28 18:01:52 CDT 2020