I would like to strip phone numbers out of a string.
The following works well except that I would like to catch 3 0 3 5 5 5 1 2 1
2
(where someone has put spaces between digits)

I know this seems unlikely but the scenario is people sending messages and
if they don't
have a paid account they are not supposed to send contact information. I
know I can't catch everything but I would like to catch the obvious tricks.
I can't just check for 9 or more digits because a string like "It is a 3 br
2 ba house with 900 square feet and I am asking $1250.00 rent" shouldn't be
"laundered".

Playing censor is a pia.


function stripphone(st,replacement){
st=rereplace(st,"[\(]?([[:digit:]]){3,3}[\.\)\(
\-]*[\(]?([[:digit:]]){3,3}[\.\)\(
\-]*[\(]?([[:digit:]]){4,4}[\)]?",replacement,"ALL");
return st;
}

Anybody have any suggestion or even a different approach

TIA

Don


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to