Skip to content

Commit 519ea79

Browse files
authored
Update _arrow_string_mixins.py
Address pandas-dev#61072.
1 parent 2030d9d commit 519ea79

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas/core/arrays/_arrow_string_mixins.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,12 @@ def _str_fullmatch(
321321
flags: int = 0,
322322
na: Scalar | lib.NoDefault = lib.no_default,
323323
):
324-
if not pat.endswith("$") or pat.endswith("\\$"):
325-
pat = f"{pat}$"
324+
if not pat.endswith("$") and not pat.startswith("^"):
325+
pat = f"^({pat})$"
326+
elif not pat.endswith("$"):
327+
pat = f"^({pat[1:]})$"
328+
elif not pat.startswith("^"):
329+
pat = f"^({pat[0:-1]})$"
326330
return self._str_match(pat, case, flags, na)
327331

328332
def _str_find(self, sub: str, start: int = 0, end: int | None = None):

0 commit comments

Comments
 (0)