O
O.B.
In the following example, the Matches operation never returns 4
matches as I am expecting. What's wrong with my syntax?
private const string DOUBLE_REGEX = @"[-|+]?[0-9]*[.]?[0-9]*";
private const string HEMISPHERE_REGEX = @"[N|S|E|W]";
string sourceString = "550402N0420502.50S";
string matchPattern = "(" + DOUBLE_REGEX + ")+" +
"(" + HEMISPHERE_REGEX + ")+" +
"(" + DOUBLE_REGEX + ")+" +
"(" + HEMISPHERE_REGEX + ")+";
Regex evaluator = new Regex(matchPattern);
MatchCollection matches = evaluator.Matches(sourceString);
matches as I am expecting. What's wrong with my syntax?
private const string DOUBLE_REGEX = @"[-|+]?[0-9]*[.]?[0-9]*";
private const string HEMISPHERE_REGEX = @"[N|S|E|W]";
string sourceString = "550402N0420502.50S";
string matchPattern = "(" + DOUBLE_REGEX + ")+" +
"(" + HEMISPHERE_REGEX + ")+" +
"(" + DOUBLE_REGEX + ")+" +
"(" + HEMISPHERE_REGEX + ")+";
Regex evaluator = new Regex(matchPattern);
MatchCollection matches = evaluator.Matches(sourceString);