tags:

views:

54

answers:

1

Hi folks,

i have the following regex pattern, which is used to strip out non, alpha-numerics.

[^0-9A-Za-z]

Works pretty good.

I was hoping to mod this regex so it looks for alphanumerics AND spaces. How can i tweek it so it also accepts spaces?

cheers :)

+6  A: 

Put a space into the brackets

[^0-9A-Za-z ]

You're question is also slightly ambiguous. I'm assuming you're looking to exclude both alphanumerics and spaces.

JaredPar
thanks mate. I've got some sql udf that returns a string, with all non-alphanumerics stripped out. I wanted to make it strip out everthing BUT alpha/numberic/spaces. (and i replace all spaces with a '-' character). works great. thanks. (DB is sql2008, btw).
Pure.Krome