Skip to content

Commit acbc366

Browse files
committed
Clarify regex interpretation in str.contains
Fix GH44811
1 parent 3397585 commit acbc366

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/strings/accessor.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1212,8 +1212,8 @@ def contains(self, pat, case=True, flags=0, na=None, regex=True):
12121212
"""
12131213
if regex and re.compile(pat).groups:
12141214
warnings.warn(
1215-
"This pattern has match groups. To actually get the "
1216-
"groups, use str.extract.",
1215+
"This pattern is interpreted as a regular expression, and has match groups. "
1216+
"To actually get the groups, use str.extract.",
12171217
UserWarning,
12181218
stacklevel=find_stack_level(),
12191219
)

0 commit comments

Comments
 (0)