From 86dc120f6a2be2ab465fa728e6fdf5b6341a129f Mon Sep 17 00:00:00 2001 From: ulif <uli@gnufix.de> Date: Fri, 31 Jul 2015 22:02:47 +0200 Subject: [PATCH] Simplify regular expressions. --- diceware/wordlist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diceware/wordlist.py b/diceware/wordlist.py index f8c07b2..f66cb76 100644 --- a/diceware/wordlist.py +++ b/diceware/wordlist.py @@ -24,14 +24,14 @@ WORDLISTS_DIR = os.path.abspath( #: A regular expression matching allowed wordlist names. We #: allow names that cannot easily mess up filesystems. -RE_WORDLIST_NAME = re.compile('^[a-zA-Z0-9_-]+$') +RE_WORDLIST_NAME = re.compile('^[\w-]+$') #: A regular expression matching numbered entries in wordlists. RE_NUMBERED_WORDLIST_ENTRY = re.compile('^[0-9]+\s+([^\s]+)$') #: A regular expression describing valid wordlist file names. RE_VALID_WORDLIST_FILENAME = re.compile( - '^wordlist_([a-zA-Z0-9_-]+)\.[a-zA-Z0-9][a-zA-Z0-9\.]+[a-zA-Z0-9]+$') + '^wordlist_([\w_-]+)\.[\w][\w\.]+[\w]+$') def get_wordlist_names(): -- GitLab