Commits

fab31 committed 8f693a1

Fixed OP_RE, fixing #17

  • Participants
  • Parent commits ae40980

Comments (0)

Files changed (1)

File zicbee_lib/parser.py

 #: Regex for tags
 TAG_RE = re.compile(r'([A-Za-z][a-z_-]*:)')
 #: Regex for operators
-OP_RE = re.compile(r'(\W|^|(?<!\\))(and|or|!)(\W|$)')
+OP_RE = re.compile(r'(?<!\w)(and|or|!)(?=\W)')
 #: Regex for groups
 GRP_RE = re.compile(r'(?<!\\)([()])')
 
         print "-"*80
         print st
         print string2python(st)[0]
+    to("artist: wax tailor")
+    to("artist: wax tailor and ! title: foo")
+    raise SystemExit()
     to("artist: björk or artist:  foobar auto:")
     to("artist: (björk or foobar) auto:")
     to("auto: artist: (björk or foobar)")
     to("auto: 20 artist: (toto or björk or foobar)")
 
-    raise SystemExit()
 
     tst_str = [
         'artist: Björk or artist: toto',