0

I have a test-string like this: "2 Test123 H: 6 Test23 2 H:2 H :5 H : 5"

I want to get only the digit after exactly "H: ". Not "H:", "H : " or "H :".

In the example it would only be the digit 6.

I tried it with a regex like this: "(?<=H:\s).*?(\d)" which also works in a regex tester.

https://www.regextester.com/

When i select from dual it delivers null.

SELECT regexp_substr('2 Test123 H: 6 Test23 2 H:2 H :5 H : 5','(?<=H:\s).*?(\d{1})') FROM DUAL;

Do you have any idea why it does not work?

2
  • SELECT regexp_substr('2 Test123 H: 6 Test23 2 H:2 H :5 H : 5','H:\s(.*?)\d', 1, 1, 'c', 1) FROM DUAL Commented Jun 10, 2024 at 14:06
  • To answer your question, the Oracle flavor of regex does not support positive lookbehinds. Commented Jun 10, 2024 at 20:56

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.