I am using System.Text.Reg ularExpressions .Regex.Replace( input, pattern, replacement, options) in c# to replace the input string. The pattern I am using may have one or more * or . or any other character basically inside mixed in with the rest of the string. I want to find this string in the input and replace it with something.
For example say my string is *000000000
I get the following error
System.Argument Exception: parsing "*000000000 " - Quantifier {x,y} following nothing.
How do I treat the * as a regular character?
I tried replacing all instances of the * character with \* before passing it to replace function but in the final output I have the \ characters along with it...I do not want that.
Thanks in advance for any help
For example say my string is *000000000
I get the following error
System.Argument Exception: parsing "*000000000 " - Quantifier {x,y} following nothing.
How do I treat the * as a regular character?
I tried replacing all instances of the * character with \* before passing it to replace function but in the final output I have the \ characters along with it...I do not want that.
Thanks in advance for any help
Comment