Skip to content

Commit 413fc95

Browse files
authored
MAINT: regex char class improve (#38817)
1 parent b438f74 commit 413fc95

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/tests/test_strings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ def test_replace_compiled_regex(self):
10661066
values = Series(["fooBAD__barBAD", np.nan])
10671067

10681068
# test with compiled regex
1069-
pat = re.compile(r"BAD[_]*")
1069+
pat = re.compile(r"BAD_*")
10701070
result = values.str.replace(pat, "", regex=True)
10711071
exp = Series(["foobar", np.nan])
10721072
tm.assert_series_equal(result, exp)
@@ -1095,7 +1095,7 @@ def test_replace_compiled_regex(self):
10951095
# case and flags provided to str.replace will have no effect
10961096
# and will produce warnings
10971097
values = Series(["fooBAD__barBAD__bad", np.nan])
1098-
pat = re.compile(r"BAD[_]*")
1098+
pat = re.compile(r"BAD_*")
10991099

11001100
with pytest.raises(ValueError, match="case and flags cannot be"):
11011101
result = values.str.replace(pat, "", flags=re.IGNORECASE)

0 commit comments

Comments
 (0)