1

Regexp_substr return only part of searching pattern.

  SELECT
  REGEXP_SUBSTR('im searching value beginning from keyword with word "number" and digits after it like number № 3 in the string',
                '(number.{0,4}\d{1,2})')

                "REGEXP_SUBSTR"
  FROM DUAL

Its returning "number №", without digits. However, search works fine: without "№ 3" in sample code it return none

3
  • Your query doesn't even work for me. What are you trying to do here? Commented Nov 11, 2019 at 16:08
  • At last. Internal function depends from client settings! Commented Nov 12, 2019 at 3:51
  • There can be differences between regex tools depending on the environment. A demo in Regex 101 is not the same as Oracle SQL's regex engine. Commented Nov 12, 2019 at 3:54

1 Answer 1

1

I think that this funky character may actually count for more than one character for Oracle. Extending .{0,4} to .{0,5} seems to work:

SELECT
  REGEXP_SUBSTR(
      'im searching value beginning from keyword with word "number" and digits after it like number № 3 in the string',
      '(number.{0,5}\d{1,2})'
  ) "REGEXP_SUBSTR"
  FROM DUAL

Demo on DB Fiddle

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, something wrong with unicode-related area. Not works on original, but on sample is :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.