Allow leading underscores in symbols in LinExpr.fromstring()
authorVivien Maisonneuve <v.maisonneuve@gmail.com>
Tue, 19 Aug 2014 09:49:10 +0000 (11:49 +0200)
committerVivien Maisonneuve <v.maisonneuve@gmail.com>
Tue, 19 Aug 2014 12:35:41 +0000 (14:35 +0200)
linpy/linexprs.py

index b5864e1..b97f048 100644 (file)
@@ -331,7 +331,7 @@ class LinExpr:
                 return left / right
         raise SyntaxError('invalid syntax')
 
                 return left / right
         raise SyntaxError('invalid syntax')
 
-    _RE_NUM_VAR = re.compile(r'(\d+|\))\s*([^\W\d_]\w*|\()')
+    _RE_NUM_VAR = re.compile(r'(\d+|\))\s*([^\W\d]\w*|\()')
 
     @classmethod
     def fromstring(cls, string):
 
     @classmethod
     def fromstring(cls, string):