Showing posts with label dirty. Show all posts
Showing posts with label dirty. Show all posts

Monday, February 20, 2012

removing all but alphanumeric characters from strings

I'm cleaning dirty data. One of the tasks is to remove any characters that
aren't alpha or numeric from a string. Can I use the replace function with a
character expression? I tried replace(@.dirtystring, '[^0-9a-zA-Z]', '') and
it didn't replace anything... any ideas?
here's a good link
http://groups.google.com/groups?q=steve+kass+John!Wa43yn&hl=en&lr=&ie=UTF-8&group=microsoft.public.sqlserver.programming&sel m=3CE46DFB.E728741%40drew.edu&rnum=2
your question is probably better suited for the .programming group over the
..server group.
hth,
Eric
Ann Queue wrote:
> I'm cleaning dirty data. One of the tasks is to remove any
> characters that aren't alpha or numeric from a string. Can I use the
> replace function with a character expression? I tried
> replace(@.dirtystring, '[^0-9a-zA-Z]', '') and it didn't replace
> anything... any ideas?
|||http://www.nigelrivett.net/RemoveNon...haracters.html
"Ann Queue" wrote:

> I'm cleaning dirty data. One of the tasks is to remove any characters that
> aren't alpha or numeric from a string. Can I use the replace function with a
> character expression? I tried replace(@.dirtystring, '[^0-9a-zA-Z]', '') and
> it didn't replace anything... any ideas?