regular expression help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chris12295
Forum Contributor
Posts: 113
Joined: Sun Jun 09, 2002 10:28 pm
Location: USA
Contact:

regular expression help

Post by chris12295 »

Is there a fast way to replace all non-alphanumeric characters with a blank space?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

there is a character-class :alpha:
and you may also use [A-Za-z0-9] or [A-Za-z0-9À-ÖØ-öø-ÿ]
User avatar
sam
Forum Contributor
Posts: 217
Joined: Thu Apr 18, 2002 11:11 pm
Location: Northern California
Contact:

Post by sam »

Code: Select all

$done = ereg_replace("ї^ї:alnum:]]","",$raw);
Cheers Sam
Post Reply