I have the regex \bname[^a-zA-Z]+[0-9]+
. This regex works on https://regexr.com/ but does not work in oracle. The pattern I am going for is:
<exact word "name" (upper or lower case)><any character/s that is a non-alphabet (including line breaks) or it can be no character><a whole number>
Where is my testing sample:
name8213
name:1232
name: 234
name
1231
name:
985
name:, 123
-- Should not match any of the below text
nameis1233
name is 123
ornaments are cool 360
nickname 1323
name 1234 1233 (should not match the second set of numbers)
However, when I execute
SELECT REGEXP_SUBSTR('name 123', '\bname[^a-zA-Z]+[0-9]+', 1, 1, 'i') FROM DUAL
I get nothing out. My end goal is to just extract that whole number.