You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is a duplicate of #24804 but it's good to see a case of an attempted meaningful single-character regex in use in the wild (while s + 'bar' is probably more common, in theory this should work).
This is a good reminder that #24804 is still there and this anomaly needs deprecation. Unless, of course, consensus now (given another year has passed and reliance interests on the pre-0.23 behavior are presumably lower) the thought is that this anomaly can just be fixed as opposed to deprecated.
Ah I see: when the pattern is a single character it's always treated as a literal, regardless of the regex parameter.
Are there plans to make to make regex=False the default? If so, perhaps this could be rolled into the same deprecation warning and API change documentation.
FWIW, my use case: we've built what's basically a lightweight report cleaning app, and the pattern to replace is user input. The app does not have a feature to prepend/append to values; rather the user should be able to accomplish this with the regex find/replace functionality.
Code Sample
Problem description
When
regex=True
,^
should match the beginning of the string, and$
should match the end of the string, but this is not the case.Expected Output
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: