On 8 May 98 at 14:55, Jack Killpatrick wrote:
> Question for perl fans:
>
> I'm sure this is simple to do, but I can't figure it out. I want to
> strip _every_ occurence of these characters out of an incoming
> string:
>
> ( ) , . and a blank space
>
> So, if the user sends me (in a POST):
>
> (415) 365-2216
>
> or
>
> 415-365.2265
>
> or
>
> 415 365 2265 (two spaces, then one)
>
> I will end up with 4153652216
Sounds like you only want the numbers. Okay, do a search and replace
for everything that is NOT A NUMBER (and replace it with NOTHING):
$tel_number =~ s/[^\d]//g;
Peter
_________________________________________________________
Peter J. Schoenster [EMAIL PROTECTED]
Exercise Your Brain..Read a Book http://www.rede.com/
Free CGI Scripts and Applications
http://www.rede.com/samples/index.html
____________________________________________________________________
--------------------------------------------------------------------
Join The Web Consultants Association : Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------