@@ -324,18 +324,18 @@ def getCoverageProblems(self):
324324 # According to the logic in rules.js available at
325325 # EFForg/https-everywhere/blob/07fe9bd51456cc963c2d99e327f3183e032374ee/chromium/rules.js#L404
326326 #
327- pattern = target .replace ('.' , '\.' ) # .replace('*', '.+')
327+ pattern = target .replace ('.' , r '\.' ) # .replace('*', '.+')
328328
329329 # `*.example.com` matches `bar.example.com` and `foo.bar.example.com` etc.
330330 if pattern [0 ] == '*' :
331331 pattern = pattern .replace ('*' , '.+' )
332332
333333 # however, `example.*` match `example.com` but not `example.co.uk`
334334 if pattern [- 1 ] == '*' :
335- pattern = pattern .replace ('*' , '[^\ .]+' )
335+ pattern = pattern .replace ('*' , '[^.]+' )
336336
337337 # `www.*.example.com` match `www.image.example.com` but not `www.ssl.image.example.com`
338- pattern = pattern .replace ('*' , '[^\ .]+' )
338+ pattern = pattern .replace ('*' , '[^.]+' )
339339
340340 pattern = '^' + pattern + '$'
341341
@@ -356,15 +356,15 @@ def getCoverageProblems(self):
356356 # Don't treat the question mark in non-capturing and lookahead groups as increasing the
357357 # number of required tests.
358358 needed_count = needed_count - \
359- len (regex .findall ("\(\?:" , rule .fromPattern ))
359+ len (regex .findall (r "\(\?:" , rule .fromPattern ))
360360 needed_count = needed_count - \
361- len (regex .findall ("\(\?!" , rule .fromPattern ))
361+ len (regex .findall (r "\(\?!" , rule .fromPattern ))
362362 needed_count = needed_count - \
363- len (regex .findall ("\(\?=" , rule .fromPattern ))
363+ len (regex .findall (r "\(\?=" , rule .fromPattern ))
364364 # Don't treat escaped questions marks as increasing the number of required
365365 # tests.
366366 needed_count = needed_count - \
367- len (regex .findall (" \ \ ?" , rule .fromPattern ))
367+ len (regex .findall (r" \?" , rule .fromPattern ))
368368 actual_count = len (rule .tests )
369369 if actual_count < needed_count :
370370 problems .append ("{}: Not enough tests ({} vs {}) for {}" .format (
@@ -374,9 +374,9 @@ def getCoverageProblems(self):
374374 needed_count = 1 + \
375375 len (regex .findall ("[+*?|]" , exclusion .exclusionPattern ))
376376 needed_count = needed_count - \
377- len (regex .findall ("\(\?:" , exclusion .exclusionPattern ))
377+ len (regex .findall (r "\(\?:" , exclusion .exclusionPattern ))
378378 needed_count = needed_count - \
379- len (regex .findall (" \ \ ?" , rule .fromPattern ))
379+ len (regex .findall (r" \?" , rule .fromPattern ))
380380 actual_count = len (exclusion .tests )
381381 if actual_count < needed_count :
382382 problems .append ("{}: Not enough tests ({} vs {}) for {}" .format (
0 commit comments