why this regex not work? i want to replace my string by all not default charaacters
legal are = a-Za-z0-9- rest should be replaced and return without the forbidden chars
protected string FormatToInvalidChars(string InputString)
{
string RegexPattern = @"(^[A-Za-z0-9]*)$";
string s = Regex.Replace(InputString.Trim(), RegexPattern, "$1");
return s;
}
thanks