So I'm reading a file and I need to count the number of logical operators in that file, from suggestions on here I've tried using Regular expressions, but the one that I am using :
Regex reg = new Regex(@"/and|x?or|&&|[<>!=]=|[<>&!]|\|{1,2}/gi");
returns everything that matches, for example it returns any variable with an "or"
in it, or if I have a "<="
operator it counts it as two separate operators ("<" and "="
separately).
Should I even use regex at this point because it doesn't seem like it would help my situation.