Skip to content
Snippets Groups Projects
Commit 924a771ece9d authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:pencil: use r to prefix regex

parent b6c6f2dda5b2
No related branches found
No related tags found
No related merge requests found
......@@ -235,7 +235,7 @@
ans_dict = self.get_dimensions_names(model)
regex = '{pre}(\d+)_{suf}'.format(pre=prefix, suf=suffix)
regex = r'{pre}(\d+)_{suf}'.format(pre=prefix, suf=suffix)
match_fct = re.compile(regex).search
matches = filter(None, map(match_fct, fields.keys()))
......@@ -290,7 +290,7 @@
ans_dict = self.get_dimensions_names(model)
found_fields = {slot: False for slot in ans_dict}
regex = '{pre}(\d+)_{suf}'.format(pre=prefix, suf=suffix)
regex = r'{pre}(\d+)_{suf}'.format(pre=prefix, suf=suffix)
path = "//field[re:match(@name, '{0}')]".format(regex)
ns = {"re": "http://exslt.org/regular-expressions"}
......
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