Skip to content
Snippets Groups Projects
Commit 66f058c0 authored by ale's avatar ale
Browse files

Ignore patterns with unsupported Perl regex constructs

parent f0ac2727
No related branches found
No related tags found
No related merge requests found
Pipeline #44565 passed
...@@ -20,7 +20,7 @@ for fn in glob.glob(os.path.join(archivebot_ignore_path, '*.json')): ...@@ -20,7 +20,7 @@ for fn in glob.glob(os.path.join(archivebot_ignore_path, '*.json')):
with open(fn) as fd: with open(fn) as fd:
print('\n\t// %s' % os.path.basename(fn)) print('\n\t// %s' % os.path.basename(fn))
for p in json.load(fd)['patterns']: for p in json.load(fd)['patterns']:
if re.search(r'\\[0-9]', p) or '(?!' in p: if re.search(r'\\[0-9]', p) or ('(?!' in p) or ('(?=' in p):
# RE2 does not support backreferences or other # RE2 does not support backreferences or other
# fancy PCRE constructs. This excludes <10 # fancy PCRE constructs. This excludes <10
# patterns from the ignore list. # patterns from the ignore list.
......
...@@ -146,7 +146,6 @@ var defaultIgnorePatterns = []string{ ...@@ -146,7 +146,6 @@ var defaultIgnorePatterns = []string{
"/discover\\?((.*&)?filtertype(_\\d+)?=){2}", "/discover\\?((.*&)?filtertype(_\\d+)?=){2}",
"/search-filter\\?(.*&)?filtertype(_\\d+)?=", "/search-filter\\?(.*&)?filtertype(_\\d+)?=",
"/simple-search\\?((.*&)?(filter_type(_\\d+)?|filtertype)=){2}", "/simple-search\\?((.*&)?(filter_type(_\\d+)?|filtertype)=){2}",
"/simple-search\\?(?=(.*&)?(filter_type(_\\d+)?|filtertype)=)(.*&)?(author|subject|dateIssued)_page=",
"[?&]dateIssued_page=\\d{2,}(&|$)", "[?&]dateIssued_page=\\d{2,}(&|$)",
"[?&]starts_with=", "[?&]starts_with=",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment