Hello, I'm creating a program that parses a for loop statement, i can do all other things that were need for a parser, now my problem is the pattern to check if the for loop statement that the user entered is correct.
Here is the pattern:
Is the pattern correct? If not what should i change in the pattern and how will i be able to check it if that pattern is working or correct?Code:public static string forLoopPattern = @"([for])" + @"([(])" + @"([int]\ \\)" + @"([a-z])" + @"([=])" + @"([0-9])" + @"([;])" + @"([a-z])" + @"([>,<,=,<=,>=,=<,=>])" + @"([0-9])" + @"([;])" + @"([a-z])" + @"([++,--])" + @"([)])";




Reply With Quote