Modify re.match usage in scripts directory.
This commit is contained in:
parent
747a9bc5b6
commit
f74832328f
@ -154,17 +154,17 @@ class AsciiDoc:
|
||||
hidden = False
|
||||
elif line == "The Compiler <mail@qutebrowser.org>\n":
|
||||
continue
|
||||
elif re.match(r'^:\w+:.*', line):
|
||||
elif re.fullmatch(r':\w+:.*', line):
|
||||
# asciidoc field
|
||||
continue
|
||||
|
||||
if not found_title:
|
||||
if re.match(r'^=+$', line):
|
||||
if re.fullmatch(r'=+', line):
|
||||
line = line.replace('=', '-')
|
||||
found_title = True
|
||||
title = last_line.rstrip('\n') + " | qutebrowser\n"
|
||||
title += "=" * (len(title) - 1)
|
||||
elif re.match(r'^= .+', line):
|
||||
elif re.fullmatch(r'= .+', line):
|
||||
line = '==' + line[1:]
|
||||
found_title = True
|
||||
title = last_line.rstrip('\n') + " | qutebrowser\n"
|
||||
|
@ -132,7 +132,7 @@ def filter_func(item):
|
||||
True if the missing function should be filtered/ignored, False
|
||||
otherwise.
|
||||
"""
|
||||
return bool(re.match(r'[a-z]+[A-Z][a-zA-Z]+', item.name))
|
||||
return bool(re.fullmatch(r'[a-z]+[A-Z][a-zA-Z]+', item.name))
|
||||
|
||||
|
||||
def report(items):
|
||||
|
@ -142,7 +142,7 @@ def parse_entry(entry):
|
||||
dict_re = re.compile(r"""
|
||||
(?P<filename>(?P<code>[a-z]{2}(-[A-Z]{2})?).*)\.bdic
|
||||
""", re.VERBOSE)
|
||||
match = dict_re.match(entry['name'])
|
||||
match = dict_re.fullmatch(entry['name'])
|
||||
if match is not None:
|
||||
return match.group('code'), match.group('filename')
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user