Skip to content

Commit 4ecb551

Browse files
fix match
1 parent f9da39d commit 4ecb551

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doc/source/whatsnew/v2.3.3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Bug fixes
3535
- Fix bug in :meth:`Series.str.replace` using named capture groups (e.g., ``\g<name>``) with the Arrow-backed dtype would raise an error (:issue:`57636`)
3636
- Fix regression in ``~Series.str.contains``, ``~Series.str.match`` and ``~Series.str.fullmatch``
3737
with a compiled regex and custom flags (:issue:`62240`)
38-
- Fix :meth:`Series.str.fullmatch` not matching patterns with groups correctly for the Arrow-backed string dtype (:issue:`61072`)
38+
- Fix :meth:`Series.str.match` and :meth:`Series.str.fullmatch` not matching patterns with groups correctly for the Arrow-backed string dtype (:issue:`61072`)
3939

4040

4141
Improvements and fixes for Copy-on-Write

pandas/core/arrays/_arrow_string_mixins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def _str_match(
316316
na: Scalar | lib.NoDefault = lib.no_default,
317317
):
318318
if not pat.startswith("^"):
319-
pat = f"^{pat}"
319+
pat = f"^({pat})"
320320
return self._str_contains(pat, case, flags, na, regex=True)
321321

322322
def _str_fullmatch(

0 commit comments

Comments
 (0)