Skip to content
Snippets Groups Projects
Commit 86a3af8d authored by ulif's avatar ulif
Browse files

Use regular expression to filter files.

parent a4f8aa54
Branches
Tags
No related merge requests found
......@@ -42,13 +42,10 @@ def get_wordlist_names():
for filename in filenames:
if not os.path.isfile(os.path.join(WORDLISTS_DIR, filename)):
continue
if "_" not in filename:
match = RE_VALID_WORDLIST_FILENAME.match(filename)
if not match:
continue
if "." not in filename:
continue
basename = filename.split(".")[0]
name = basename.split("_", 1)[1]
result.append(name)
result.append(match.groups()[0])
return sorted(result)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment