Simple Regex needed

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
aliasxneo
Forum Contributor
Posts: 136
Joined: Thu Aug 31, 2006 12:01 am

Simple Regex needed

Post by aliasxneo »

I'm not very good with Regex and couldn't fine a quick way to do this. I just need to replace all (will be doing this in php with preg_replace) non-character or numerals in a string. So anything not A-Z, a-z, or 0-9 should get replaced. How can I do this? Thanks in advance.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: Simple Regex needed

Post by superdezign »

Code: Select all

[^A-Za-z0-9]
aliasxneo
Forum Contributor
Posts: 136
Joined: Thu Aug 31, 2006 12:01 am

Re: Simple Regex needed

Post by aliasxneo »

superdezign wrote:

Code: Select all

[^A-Za-z0-9]
Thank you :)
Post Reply