I want to filter out the char ^ before searching something in a database. What will my regular expression look like if i want to achieve that the query will ignore this sign: ^ ? I'm working with VS2008 .net 3.5 and C#.
+9
A:
You don't need a regex for that, you can simply do this:
myString = myString.Replace("^","");
BFree
2010-01-25 12:35:10
I thought a regex would be better ;) thanks tho!
Younes
2010-01-25 12:51:16
+1
A:
If you want to filter only that character a simple String.Replace() call would suffice. Anyway, if you want to use a Regular expression you must escape the ^, since it is a special char.
myString = Regex.Replace(myString, "\^+", String.Empty);
mamoo
2010-01-25 12:35:33