Commit 96096407 authored by Igor Dejanovic's avatar Igor Dejanovic

Added flags parameter to RegExMatch.

It is used to pass re flags to compile function.
parent 59b4c15d
...@@ -348,12 +348,15 @@ class RegExMatch(Match): ...@@ -348,12 +348,15 @@ class RegExMatch(Match):
''' '''
This Match class will perform input matching based on Regular Expressions. This Match class will perform input matching based on Regular Expressions.
''' '''
def __init__(self, to_match, rule=None): def __init__(self, to_match, rule=None, flags=None):
''' '''
@param to_match - regular expression string to match. @param to_match - regular expression string to match.
''' '''
super(RegExMatch, self).__init__(rule) super(RegExMatch, self).__init__(rule)
self.to_match = to_match self.to_match = to_match
if flags is not None:
self.regex = re.compile(to_match, flags)
else:
self.regex = re.compile(to_match) self.regex = re.compile(to_match)
def _parse(self, parser): def _parse(self, parser):
......
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