Re: simple regular expression problem?
| From: | Folke Ashberg | Date: | Fri, 24 Nov 2000 21:12:56 +0000 |
| Subject: | Re: simple regular expression problem? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27041@lists.php.net to get a copy of this message | ||
<?
$str="3453()(§$!?'5asfasdf234AAA";
$str=eregi_replace("[^a-z0-9]","",$str);
print $str;
?>
All not a-z and 0-9 will be replaced with an empty string.
ciao
Folke
--
Folke Ashberg
Stage Internet Services GmbH
Technical Development
folke@fanstage.de
folke@fanstage.de | Tel: +49 89 454591-77 | Fax: +49 89 454591-71
Kreillerstr. 21 | 81673 Munich | Germany | www.fanstage.de
On Fri, 24 Nov 2000, Bernd Duesmann wrote:
> hi there,
>
> i need a regexpr that only let the following letters pass:
>
> a-z lower case
> A-Z upper case
> 0-9 and an underscore
>
> if there is another character in the string there should be an error
> message.
>
>
> thanx for your help
> bernd
>
>
>
>
> .....................................
> Bernd Duesmann
> .....................................
>
> UNDERBASEMENT
> Internet & Kommunikation
> Duesmann, Schön & Teigelmeister GbR
> Friedrich - Ebert - Strasse 10
> 33602 Bielefeld
> Germany
>
> T 05 21.5 21 41 54
> F 05 21.5 21 41 55
> E duesmann@underbasement.de
> I http://www.underbasement.de
>
>
> .....................................
>
> aktuelle Projekte: http://www.rushclub.de
> http://www.kulturfeld.net
>
>
>
>
>
>
>