I believe there is an error in the regex for HW01 for the BNF. I assume should be something like:
.
([+|-]\d+(\s+[AND|OR]\s+'[+|-] '\d+)*)?
.
To make it work properly in python, you need to change the regex to accept "AND"/"OR" as phrases and to bound to the whole string as shown below:
.
^([+|-]\d+(\s+?(AND|OR)\s+[+|-]\d+)*)?$
.
If I am wrong, please let me know.
(
Edited: 2017-09-03)
I believe there is an error in the regex for HW01 for the BNF. I assume should be something like:
.
([+|-]\d+(\s+[AND|OR]\s+''<u>'[+|-]</u>'''\d+)*)?
.
To make it work properly in python, you need to change the regex to accept "AND"/"OR" as phrases and to bound to the whole string as shown below:
.
^([+|-]\d+(\s+?(AND|OR)\s+[+|-]\d+)*)?$
.
If I am wrong, please let me know.