Reputation: 33
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
Upvotes: 1
Views: 120
Reputation: 222702
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
Upvotes: 1