Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include a check.match and check.not_match for regex comparison #164

Open
LecrisUT opened this issue May 5, 2024 · 1 comment
Open

Include a check.match and check.not_match for regex comparison #164

LecrisUT opened this issue May 5, 2024 · 1 comment

Comments

@LecrisUT
Copy link

LecrisUT commented May 5, 2024

Should be straightforward as:

def match(regex, string, msg=""):
    __tracebackhide__ = True
    if regex.match(string):
        return True
    else:
        log_failure(f"check {regex}.match({string})", msg)
        return False

In the meantime check.is_true could also be used.

@okken
Copy link
Owner

okken commented Aug 27, 2024

This might be cool. I'd consider a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants