Commit 063c141a authored by Jérome Perrin's avatar Jérome Perrin

*: fix warnings with regex

parent 9c8624b1
......@@ -684,7 +684,7 @@ class SelectionTool( BaseTool, SimpleItem ):
# qdsqdsq/Base_view/qsdsqd --> matches
# qdsqdsq/Base_viewAaa --> doesn't match
# qdsqdsq/Umpa_view --> doesn't match
if re.search('/%s($|\W+)' % form_id, url):
if re.search(r'/%s($|\W+)' % form_id, url):
return form_id
return 'view'
......
......@@ -128,7 +128,7 @@ class PersistentContainer(Persistent):
self.value = state
global registered_workflow_method_set
wildcard_interaction_method_id_match = re.compile(r'[[.?*+{(\\]').search
wildcard_interaction_method_id_match = re.compile(r'[\[.?*+{(\\]').search
workflow_method_registry = [] # XXX A set() would be better but would require a hash in WorkflowMethod class
def resetRegisteredWorkflowMethod(portal_type=None):
......
......@@ -770,7 +770,7 @@ from .Accessor.Base import func_code
from Products.CMFCore.utils import manage_addContentForm, manage_addContent
from AccessControl.PermissionRole import PermissionRole
python_file_parser = re.compile('^(.*)\.py$')
python_file_parser = re.compile(r'^(.*)\.py$')
def getLocalPropertySheetList():
if not getConfiguration:
......@@ -1748,12 +1748,12 @@ from six.moves.urllib.parse import urlsplit, urlunsplit, urljoin
# Regular expressions
re_cleanup_anchors = re.compile('#.*')
re_extract_port = re.compile(':(\d+)$')
re_extract_port = re.compile(r':(\d+)$')
def uppercaseLetter(matchobject):
return matchobject.group(0).upper()
re_cleanup_escaped_url = re.compile('%\w\d')
re_cleanup_escaped_url = re.compile(r'%\w\d')
re_cleanup_slashes = re.compile('/{2,}')
re_cleanup_tail = re.compile('\??$')
re_cleanup_tail = re.compile(r'\??$')
def legacyNormalizeUrl(url, base_url=None):
"""this method does normalisation itself.
......
......@@ -184,7 +184,7 @@ class EmailValidator(StringValidator):
# brackets around the address (we assume these would be added by
# some custom script if needed), and of course no characters that
# don't belong in an e-mail address.
pattern = re.compile('^[0-9a-zA-Z_\'&.%+-]+@([0-9a-zA-Z]([0-9a-zA-Z-]*[0-9a-zA-Z])?\.)+[a-zA-Z]{2,}$')
pattern = re.compile(r'^[0-9a-zA-Z_\'&.%+-]+@([0-9a-zA-Z]([0-9a-zA-Z-]*[0-9a-zA-Z])?\.)+[a-zA-Z]{2,}$')
def validate(self, field, key, REQUEST):
value = StringValidator.validate(self, field, key, REQUEST)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment