× 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.



Arnie,

My alternate theory (when prodded by John Yeung) was that it was not treating [\x00-\x3f] as a range, but as a list, explained the result I got with my test data, but not with yours.

Your theory makes sense, since all those regex functions are probably just ported from some *nix implementation and it was easier to convert the source parameter from EBCDIC to ASCII and then process it than figure out how to have them handle EBCDIC values. I guess as long as you're using regex for text strings, that will work. Makes it less useful for binary data.

My only consolation is that at least I was specifying the range correctly :(

--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx <mailto:petercdow@xxxxxxxxx>
pdow@xxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxx> /



On 8/15/2021 11:48 PM, Arnie Flangehead wrote:
Your results are consistent with my theory.

Since the hyphen (identified in the conversion tables as 'subtraction
sign') is ASCII x'2d' but EBCDIC x'60' it will be found within the range
x'00' to x'3f' if, as I suspect, the string passed into the regex processor
(wherever that may be) is evaluated as ASCII instead of EBCDIC.

btw, I like the simple VALUES EXPRESSION format you use for your tests.
Don't know why I didn't think of that and waste my time building common
tables.

Another test clinches it:
values regexp_instr('grave`concern_', '[\x5f-\x60]') -- Result 6
... take the grave out and replace with a space
values regexp_instr('grave concern_', '[\x5f-\x60]') -- Result 14

The grave symbol is ASCII x'60' and underscore x'5f'
The EBCDIC equivalents are x'79' and x'6d' so we shouldn't have found
either.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.