Skip to content

regexutils

regexutils

Module for regular expression utilities

Functions

check_exp_name

check_exp_name(exp_name)

Checks if an experiment name matches a pattern (EXP_NAME_PATTERN) Args: exp_name: experiment name to check

Returns:

  • bool

    True if exp_name matches the pattern

Source code in niceml/utilities/regexutils.py
def check_exp_name(exp_name: str) -> bool:
    """
    Checks if an experiment name matches a pattern (EXP_NAME_PATTERN)
    Args:
        exp_name: experiment name to check

    Returns:
        True if `exp_name` matches the pattern
    """
    pattern = re.compile(EXP_NAME_PATTERN)
    return bool(pattern.match(exp_name))