I want to get 12.1.0.2.170117 from PSU 12.1.0.2.170117. The pattern ([\d|\.]+) seems to work fine: https://regex101.com/r/bDCF0w/1
However, it does not work as expected in Oracle's regexp_replace: http://sqlfiddle.com/#!4/53d64e/77. Do I miss something? Why does it also return PSU, when I only have \d and \. in my expression?
My text could as well be PSU SOMTHING SOMTHING 12.1.0.2.170117 AND HERE SOME.
My final goal is to also get read of first 3 dots.
Here is one way to do this using REGEXP_REPLACE with
a capture group:
SELECT
REGEXP_REPLACE('PSU 12.1.0.2.170117', '^.*?([0-9.]+).*$', '\1')
FROM dual;
The approach above is to isolate and capture any quantity of dots or numbers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With