diff options
-rw-r--r-- | order_of_operations_parser.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/order_of_operations_parser.php b/order_of_operations_parser.php index 3b29771..d025d8f 100644 --- a/order_of_operations_parser.php +++ b/order_of_operations_parser.php @@ -83,7 +83,14 @@ for (i=0;i<=$numRecords;i++) //Now we need to determine if a particular question contained ONLY a particular operation - if (preg_match($regexp, $equation + + //Matches operations with ONLY ADDITION + if (preg_match($regexp, $equation) && !preg_match("-", $equation), && !preg_match("/", $equation), && !preg_match("*", $equation)) + { + only_addition[tok[2]]++ + } + + /*# Matches operations with ONLY ADDITION if ( !match($3, /\//) && !match($3, /[0-9]\-[0-9]/) && match($3, /\+/) && !match($3, /\*/) ) |