Original Post
Ok, so here is the Regex declaration:
public static Regex GliderCharacterHealthPattern = new Regex("^Health: \\d|\\d\\.\\d+$");
and here is the code to see if a string matches the Regex pattern:
else if(StringPatterns.GliderCharacterHealthPattern.IsMatch(data))
{
_GliderStatus.CharacterHealth = float.Parse(data.Substring(data.IndexOf(':') + 2));
}
Now, for some reason when this string goes through the check "Location: -1615.49 -1997.51", it says it matches the pattern... Could someone please tell me why, as I am very new to Regex. Thanks for the help.