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



Can someone help me to understand this? I hate being ignorant.

I have tried this out and understand that it works - but I do not know why.

'.* ' - How does this tell REGEX that it should match up to and including the last space/blank?

I have read the manual and find nothing that lets me interpret this as replace all characters up to and including the last space.
I have modified the pattern it to '.*N'

values rtrim(regexp_replace ('NTE*OTH*#OH- HANDLING CHARGES GSYE9R03/WHT/ / 4T/- 2.29~', '.*N'), '~');

and it returned

'G CHARGES GSYE9R03/WHT/ / 4T/- 2.29'

Which means it replaced everything up to and including the last 'N' with an empty string.

My question is: How?


Paul

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Niels Liisberg
Sent: Friday, July 31, 2020 3:55 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: How to get the dollar value from this text string?

Agreed Jon, I think I will challenge Birgita on that one:

Here i my one-liner solution: Remove any characters until the last blank, Picup the number and remove the filal ~

**free

dcl-s instr varchar(256);

dcl-s dolar packed( 15: 2);



inStr = 'NTE*OTH*#OH- HANDLING CHARGES GSYE9R03/WHT/ / 4T/-
2.29~';

exec sql values rtrim(regexp_replace (:instr, '.* '),'~') into :dolar;


return;




On Thu, Jul 30, 2020 at 4:33 PM Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:

OMG that is UGLY!


On Jul 30, 2020, at 1:56 AM, Birgitta Hauser
<Hauser@xxxxxxxxxxxxxxx>
wrote:

The following SQL-Statement should return the numbers only:
Select Dec(RegexP_Replace(Substr(Text,Locate_In_String(Text, '/',
-1) +
1),
'[\s^~]', ''), 11, 2),
Text
from
(Values('NTE*OTH*#F7- PST/SALES TAX GAZE9H01/MNT/ / 6/- 1,23~'),
('NTE*OTH*#F7- PST/SALES TAX GSYE9R03/WHT/ / 4T/- 1,22~'),
('NTE*OTH*#OH- HANDLING CHARGES GAZE9H01/MNT/ / 6/- 3,36~'),
('NTE*OTH*#OH- HANDLING CHARGES GSYE9R03/WHT/ / 4T/- 2,29~')) x
(Text);

Mit freundlichen Gr en / Best regards

Birgitta Hauser


"Shoot for the moon, even if you miss, you'll land among the stars."
(Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not
training
them
and keeping them!"
Train people well enough so they can leave, treat them well enough
so
they
don't want to. (Richard Branson)


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf
Of
Kevin
Bucknum
Sent: Mittwoch, 29. Juli 2020 20:04
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: Re: How to get the dollar value from this text string?

If you do have regex setup and working from sql on your box, then
this little quick and dirty program extracts everything after the last space.
That includes that ~ but you can remove that.

**Free
Dcl-s V1 Char(100);
Dcl-s Result Char(10);
V1 = 'NTE*OTH*#OH- HANDLING CHARGES GAZE9H01/MNT/ / 6/- 3.36~';

Exec Sql Select Regexp_Substr(
Trim(:V1),
'[\S]+$')
Into :Result
From sysibm.sysdummy1;

Dsply Result;
*Inlr = *On;
Return;


On Wed, 2020-07-29 at 11:48 -0600, Jack Woehr wrote:

the regex for that is something like


.*(\d*\.\d\d).*


when $1 will be your dollar figure.


--

Jack Woehr

Absolute Performance, Inc.

12303 Airport Way, Suite 100

Broomfield, CO 80021


NON-DISCLOSURE NOTICE: This communication including any and all

attachments is for the intended recipient(s) only and may contain

confidential and privileged information. If you are not the
intended

recipient of this communication, any disclosure, copying further

distribution or use of this communication is prohibited. If you
received

this communication in error, please contact the sender and
delete/destroy

all copies of this communication immediately.



[https://www.medtronsoftware.com/img/MedtronMinilogo.bmp] Kevin
Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
https://www.medtronsoftware.com



CONFIDENTIALITY NOTICE

This document and any accompanying this email transmission contain
confidential information, belonging to the sender that is legally
privileged. This information is intended only for the use of the
individual
or entity named above. The authorized recipient of this information
is prohibited from disclosing this information to any other party
and is required to destroy the information after its stated need has
been fulfilled. If you are not the intended recipient, or the
employee of
agent
responsible to deliver it to the intended recipient, you are hereby
notified
that any disclosure, copying, distribution or action taken in
reliance on the contents of these documents is STRICTLY PROHIBITED.
If you have received this email in error, please notify the sender
immediately to arrange for return or destruction of these documents.
--
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

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

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

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