×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Apologies if this isn't quite the correct forum for this question, but it
seems a good place to get a chance of a second opinion...
Has anyone noticed anything funny with the look around regex capabilities
of DB2 ( 7.1 )
For example
Applying
(?<!a)\d(?!a)
To
B2B
It should return
2
But it seems to find a match but with no text returned.
E.g if you run:
Select
Regexp_substr( 'B2B' , '(?<!a)\d(?!a' )
From sysibm/sysdummy1
It doesn't return null and it appears as blank in STRSQL.
whereas if you run the regex over 'a2B' you clearly get null returned.
But it should select the digit as far as I understand.
Further,
Select
Regexp_replace( 'B2B' , '(?<!a)\d(?!a', '#' )
From sysibm/sysdummy1
Will return B#2B
which seems to indicate that the regex selected the position just after the
B where the negative look behind matched, but then didn't appear to go on
and match the digit.
Does this make sense to anyone?
The regex is saying "find me a digit which doesn't have an "a" on either
side of it"
Am I missing something obvious?
Thanks,
Craig
As an Amazon Associate we earn from qualifying purchases.