mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00: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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user