From f25e92d443a3c47770f8037020405d8697f0f876 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Wed, 15 Aug 2012 09:12:55 -0500 Subject: [PATCH] \w_ replaced with \w, thanks Osman --- VERSION | 2 +- applications/admin/controllers/default.py | 2 +- gluon/contrib/markmin/markmin2latex.py | 2 +- gluon/dal.py | 6 +++--- gluon/myregex.py | 2 +- gluon/validators.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/VERSION b/VERSION index e6313769..c0946b00 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-08-15 09:06:31) dev +Version 2.00.0 (2012-08-15 09:12:50) dev diff --git a/applications/admin/controllers/default.py b/applications/admin/controllers/default.py index 556188eb..f6566500 100644 --- a/applications/admin/controllers/default.py +++ b/applications/admin/controllers/default.py @@ -182,7 +182,7 @@ def site(): class IS_VALID_APPNAME(object): def __call__(self,value): - if not re.compile('[\w_]+').match(value): + if not re.compile('\w+').match(value): return (value,T('Invalid application name')) if not request.vars.overwrite and \ os.path.exists(os.path.join(apath(r=request),value)): diff --git a/gluon/contrib/markmin/markmin2latex.py b/gluon/contrib/markmin/markmin2latex.py index 610259f2..564f9905 100755 --- a/gluon/contrib/markmin/markmin2latex.py +++ b/gluon/contrib/markmin/markmin2latex.py @@ -139,7 +139,7 @@ def render(text, text = regex_noindent.sub('\n\\\\noindent \g',text) ### fix paths in images - regex=re.compile('\\\\_[\w_]*\.(eps|png|jpg|gif)') + regex=re.compile('\\\\_\w*\.(eps|png|jpg|gif)') while True: match=regex.search(text) if not match: break diff --git a/gluon/dal.py b/gluon/dal.py index 20c66773..4914d22a 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -210,12 +210,12 @@ sql_locker = threading.RLock() thread = threading.local() # internal representation of tables with field -# ., tables and fields may only be [a-zA-Z0-0_] +#
., tables and fields may only be [a-zA-Z0-9_] regex_type = re.compile('^([\w\_\:]+)') regex_dbname = re.compile('^(\w+)(\:\w+)*') -regex_safe = re.compile('^[\w_]+$') -regex_table_field = re.compile('^([\w_]+)\.([\w_]+)$') +regex_safe = re.compile('^\w+$') +regex_table_field = re.compile('^(\w+)\.(\w+)$') regex_content = re.compile('(?P
[\w\-]+)\.(?P[\w\-]+)\.(?P[\w\-]+)\.(?P\w+)\.\w+$') regex_cleanup_fn = re.compile('[\'"\s;]+') string_unpack=re.compile('(?[\w_]+)[\'\"]""", + """^[\w]+\.define_table\(\s*[\'\"](?P\w+)[\'\"]""", flags=re.M) # pattern to find exposed functions in controller diff --git a/gluon/validators.py b/gluon/validators.py index 46f4b60c..f4ebfc0e 100644 --- a/gluon/validators.py +++ b/gluon/validators.py @@ -381,7 +381,7 @@ class IS_IN_SET(Validator): return (value, None) -regex1 = re.compile('[\w_]+\.[\w_]+') +regex1 = re.compile('\w+\.\w+') regex2 = re.compile('%\((?P[^\)]+)\)s')