Check whether the string matches a regex pattern.
x (object) – Value to check.
pattern (str) – Regular expression pattern.
True if x is a string and matches pattern.
True
x
pattern
bool
Examples
>>> is_matching_regex("foobar", "^f") True >>> is_matching_regex("foobar", "^b") False