Roberto Perez wrote:
> 
> On further testing, this is what is happening: the two characters 
> included in the regex below, the forward slash "/" and the dot "." do 
> not get stripped:
> 
> #rereplace(FORM.GPA, '[^0-9/.]', '', 'all')#
> 
> So my questions are:
> 1- Does the forward slash perform a specific function, so that it has 
> to stay in the regex?

No. I think its presence is an error and it should be a backslash.


> 2- If the user enters a dot with no numbers, e.g., "na.", the letters 
> get stripped (which is good) but the dot does not, and it creates an 
> error similar to the one quoted above. Any way of detecting such 
> instances of dots with no numbers?

IsNumeric() on the result of the replace operation.


> 3- The MM document at 
> (http://livedocs.macromedia.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/regexp3.htm#1117230)says
>  
> the carat at the beginning of the regex makes it match only 
> characters that appear at the beginning of the string. But in my 
> tests, alphanumeric characters in any position get stripped. Am I 
> reading the MM document properly?

No. A ^ only matches the beginning of a string if it is the first 
character in the regular expression. If it occurs in any other 
position it is the NOT operator.

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232843
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to