- Home /
Parse Error: unrecognized escape sequence (\w+,\})
i'm trying to find the text using regex and get the strange error.
Here is the part of code:
using System.Text.RegularExpressions;
string param = "class \{\n\t\"id\" \"91\"\n\t\"name\" \"charly\"\n\}";
MatchCollection mthes = Regex.Matches(param, @"\"(\w+)\"\s*\"(.*?)?\"");
foreach (Match mth in mthes) {
if (mth.Success) {
... = mth.Groups[1].Value;
... = mth.Groups[2].Value;
}
}
Why this causes the error?
Thanks for help.
Comment
Your answer
Follow this Question
Related Questions
using Regular Expressions with mySQL & Facebook? 0 Answers
Get the upper Chars out of a string 1 Answer
Substring vs Regex 2 Answers
Automatic GUI generation systems? 1 Answer
LINQ Find String Duplicates in List 1 Answer