Welcome, Guest. Please Login or Register.
eccoMAGIC Forums
05/06/24 at 11:08:30
Home Help Search Login Register


Pages: 1
Send Topic Print
Regex token \. does not appear to function (Popularity: 4545 )
albertschepers
Contributing  Member
***


I Love Ecco!

Posts: 11
Gender: male
Show the link to this post Regex token \. does not appear to function
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
Back to top
 
 

Albert Schepers
Email WWW   IP Logged
Alec_Burgess
EccoMagic Apprentice
*


We all Love Ecco!

Posts: 0
Gender: male
Show the link to this post Re: Regex token \. does not appear to function
Reply #1 - 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.
Back to top
 
 

Regards ... Alec
Email   IP Logged
albertschepers
Contributing  Member
***


I Love Ecco!

Posts: 11
Gender: male
Show the link to this post Re: Regex token \. does not appear to function
Reply #2 - 12/10/07 at 08:06:11
 
Thak you very much. I had misinterpreted the uses of the . All is good (for now).
 
Albert
Back to top
 
 

Albert Schepers
Email WWW   IP Logged
Pages: 1
Send Topic Print