I'm converting a project from java to C#. I have no idea what the equivalence of following regular expression would be in C#.
The regular expression : Customer rating (?<rating>\d.\d)/5.0
The java string : "Customer rating (?<rating>\\d.\\d)/5.0"
This is the java code:
private static final Pattern ratingPattern = Pattern.compile("Customer rating (?<rating>\\d.\\d)/5.0");
...
m = Retriever.ratingPattern.matcher(X);
if (m.matches()) {
...
}
and it works for ( X=Customer rating 1.0/5.0 ). But this is the C# code:
static Regex rx = new Regex(@"Customer rating (?<rating>\\d.\\d)/5.0");
...
MatchCollection matches = rx.Matches(X);
if (matches.Count > 0)
{
...
}
and it doesn't work for ( X=Customer rating 1.0/5.0 ).I mean (Matches.count) is always 0 for ( X=Customer rating 1.0/5.0 )
Please help me if you have any ideas.
Thank you