Link to home
Start Free TrialLog in
Avatar of skahlert2010
skahlert2010

asked on

Regular Expression

Can you please give me an example for the following task?

I need to extract the number after "thread" from the following string using regexp_substr in Oracle:

Archived Log entry 86041 added for thread 2 sequence 8100 ID 0xffffffff89e2d6df dest 1:

I was able to extract the first and the last number but not the one following the word thread.

I'd be glad for an example.

Thank you
Avatar of skahlert2010
skahlert2010

ASKER

Okay, I figured out that I may use this

REGEXP_SUBSTR(mystring, '[[:digit:]]+',2,2)

Open in new window


However, there are probably numerous other attempts that are interesting to learn. So please don't hesitate if you have a suggestion!
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
you can use the posix class instead of range specifier in either of the solutions above
ASKER CERTIFIED SOLUTION
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
Just what I needed!

Thanks again sdstuber! Nice examples!

Anything you don't have an answer for??? :-)
examining a logfile can be cumbersome
>> did you check table v$archived_log ?