I have a string/column something like this
String a = \"000003023_AggregateStopLossLimit_W x3A 973911_2012-12-22.PDF\";
I want to create a subs
The Java solution given by @Kent above is very elegant and I recommend it. That said, if you want to accomplish this using Oracle's regex engine, you might try the following:
WITH t1 AS (
SELECT '000003023_AggregateStopLossLimit_W x3A 973911_2012-12-22.PDF' AS filename
FROM dual
)
SELECT filename, REGEXP_REPLACE(filename, ' [^_]*', '')
FROM t1