maxframe.liteframe.LiteFrame.str.match#
- LiteFrame.str.match(pat: str | Pattern, case: bool | Literal[_NoDefault.no_default] = <no_default>, flags: int | Literal[_NoDefault.no_default] = <no_default>, na=<no_default>)#
Determine if each string starts with a match of a regular expression.
Determines whether each string in the Series or Index starts with a match to a specified regular expression. This function is especially useful for validating prefixes, such as ensuring that codes, tags, or identifiers begin with a specific pattern.
- Parameters:
pat (str or compiled regex) – Character sequence or regular expression.
case (bool, default True) – If True, case sensitive.
flags (int, default 0 (no flags)) – Regex module flags, e.g. re.IGNORECASE.
na (scalar, optional) – Fill value for missing values. The default depends on dtype of the array. For the
"str"dtype,Falseis used. For object dtype,numpy.nanis used. For the nullableStringDtype,pandas.NAis used.
- Returns:
A Series, Index, or array of boolean values indicating whether the start of each string matches the pattern. The result will be of the same type as the input.
- Return type:
Series/Index/array of boolean values