mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Simplify regex filter code (#50202)
This was written when we were redefining `bool` in the same module. As we aren't doing this any longer, simplify it back to just calling `bool()`.
This commit is contained in:
parent
89a1c68f98
commit
07605923e1
1 changed files with 1 additions and 2 deletions
|
@ -120,8 +120,7 @@ def regex(value='', pattern='', ignorecase=False, multiline=False, match_type='s
|
|||
if multiline:
|
||||
flags |= re.M
|
||||
_re = re.compile(pattern, flags=flags)
|
||||
_bool = __builtins__.get('bool')
|
||||
return _bool(getattr(_re, match_type, 'search')(value))
|
||||
return bool(getattr(_re, match_type, 'search')(value))
|
||||
|
||||
|
||||
def match(value, pattern='', ignorecase=False, multiline=False):
|
||||
|
|
Loading…
Reference in a new issue