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



I think what's wrong is probably the last parameter which should be $1 not
just 1.
The other thing is that what you may need is to remove the characters, so
you should put a caret character before a set l[A-za-z]'.

Regex is not difficult but tricky you have to play a while to get what you
want.

Javier.


El lun, 11 jul 2022 a las 10:22, Stephen Landess (<steve_landess@xxxxxxxxxxx>)
escribió:

Our system is running IBM i 7.3 with the latest PTF's and TR's (PTF's and
TR's installed in the last 2 weeks).

Jerry Ven recently asked questions about extracting the numeric values
from a character field to use as a key for joining the file to another
file which has a numeric key.

I believe that someone had suggested using the SQL REGEXP_REPLACE scalar
function.

Searching for examples, I found this:

https://stackoverflow.com/questions/56151437/ibm-db2-select-numeric-characters-only-from-a-column

which gave the following example:


SELECT REGEXP_REPLACE(
'123Red345', '[A-Za-z]','',1)
FROM sysibm.sysdummy1

indicating that this statement should return the value '123345'.

However, when I run this SQL statement it returns the value
'123Red345'.

What gives?

Regards,
Steve Landess
(512) 289-0387
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.