pandas.Series.str.match

Series.str.match(pat, case=True, flags=0, na=nan)[source]

Determine if each string matches a regular expression.

Parameters:
pat : string

Character sequence or regular expression

case : boolean, default True

If True, case sensitive

flags : int, default 0 (no flags)

re module flags, e.g. re.IGNORECASE

na : default NaN, fill value for missing values
Returns:
Series/array of boolean values

See also

contains
Analogous, but less strict, relying on re.search instead of re.match.
extract
Extract matched groups.
Scroll To Top