mohammadzahid
asked on
Oracle regular expression
Using Oracl regular expressions I want to extract character after the \
'OPS$BCTGTWDOM\SMANAVI' Output => SMANAVI
How can I do this?
Thanks
'OPS$BCTGTWDOM\SMANAVI' Output => SMANAVI
How can I do this?
Thanks
Someone will post it so here is the regexp_substr:
select regexp_substr('OPS$BCTGTWD OM\SMANAVI ','[^\]+$' ) from dual;
select regexp_substr('OPS$BCTGTWD
why use regexp where INSTR and SUBSTR will do this as well (and more efficiently)?
if you only need to identify the backslash and then clip out the text which follows it, regexp is a sledgehammer to crack a nut.
if you only need to identify the backslash and then clip out the text which follows it, regexp is a sledgehammer to crack a nut.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
I would use SUBSTR and INSTR. It will likely be faster:
select substr('OPS$BCTGTWDOM\SMAN
that was hard-coded. I assume you have it in a table?
select substr(yourcolumn,instr(yo