So I have spent far too long on this and have tried tons of things with no luck. I think I am just bad at regex. I am trying to clean a string of ALL non alpha numeric characters but leaving spaces. I DO NOT WANT TO USE [^A-Za-z0-9 ]+
due language concerns.
Here are a few things I have tried:
cleaned_string = Regex.Replace(input_string, @"[^\w ]+[_]+);
cleaned_string = Regex.Replace(input_string, ([^\w ]+)([_]+));
cleaned_string = Regex.Replace(input_string, [^ \w?<!_]+);
Edit: Solved thanks to a very helpful person below.
My final product ended up being this: [_]+|[^\w\s]+
Thanks for all the help!
[^\w\_]
\_
was one of the first things I tried and it caused an exception."[\\W_]"
seems to work locally for me.