The eccoMAGIC Forums
http://forums.eccoMAGIC.com/forum/YaBB.pl
the SLANG EXTENSION and Guest Programming >> Bug Reports for Slangmgh >> Regex token \. does not appear to function
http://forums.eccoMAGIC.com/forum/YaBB.pl?num=1197138912

Message started by albertschepers on 12/08/07 at 12:35:12

Title: Regex token \. does not appear to function
Post by albertschepers on 12/08/07 at 12:35:12

with the item text

$20.00 Description of Amount

the expression

\$\s*\d*.\d{2}\s*(\.*)

should return the last part of the expression (\.*) the

Description of Amount



which to my understanding should be anything that follows the location in the string that is matched

Therefore in the eccoext expression

ireplace(ITT,"\$\s*\d*.\d{2}\s*(\.*)",{1},true)

should replace the text with the "Description of Amount".


Now either I am failing to understand something and blew it completely or the \. is not working.

Albert

Title: Re: Regex token \. does not appear to function
Post by Alec_Burgess on 12/08/07 at 17:06:58

Albert:

Quote:
\$\s*\d*.\d{2}\s*(\.*)

I think you've got the slashes on the wrong side of the dots in the above.
the correct expression s/b
\$\s*\d*\.\d{2}\s*(.*)

ie. you need \ in front of first . to make it match literally the decimal place in the number (w/o the slash DOT matches ANYTHING)
At the end of the expression you had \.* - this matches zero or more occurrences of a Literal DOT rather than zero or more occurrences of ANY character.

Title: Re: Regex token \. does not appear to function
Post by albertschepers on 12/10/07 at 08:06:11

Thak you very much. I had misinterpreted the uses of the . All is good (for now).

Albert

The eccoMAGIC Forums » Powered by YaBB 2.1!
YaBB © 2000-2005. All Rights Reserved.