I've created a program to parse out text as the program recieved it and use Regex matching to decide what should be done. My problem is that the text is matching when it shouldn't be, if that makes any sense.
Expand|Select|Wrap|Line Numbers
- If Regex.IsMatch(Text, "You find (a|an)" & MoneyMatch) Then
- Other code here that doesn't matter.
- ElseIf Regex.IsMatch(Text, "([A-Z][a-z]+\s)obtains (a|an)") Then
- More code that doesn't matter.
- EndIf
You find (a|an) MoneyMatch (string).
([A-Z][a-z]+\s) obtains (a|an) MoneyMatch.
The problem is that both lines are matching to the first case. I had thought that my first Regex.IsMatch required that the line match "You find a Money", so it would exclude the second case. I believed that the error may be in the "IsMatch" part of the code. I assumed that required a full line match, but is a partial match enough to get a return value?
Any help is appriciated.