Open giangiacomosanna opened 4 years ago
there are a lot of very similiar issues eg https://github.com/pandas-dev/pandas/issues/24804
a single character is treated as not a regex. i suppose could be documented (i think it is in places).
PRs to fix are welcome.
[x] I have checked that this issue has not already been reported.
[x] I have confirmed this bug exists on the latest version of pandas.
[ ] (optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
Problem description
Currently some pandas string functions (eg str.replace, str.split) treat
"."
as a regex matching any character, while some others (eg str.contains) treat it like"[.]"
, the regex matching the "dot" character. The".."
string is instead always correctly handled as the regex matching any two characters.Expected Output
pandas string functions (when in regex mode) should treat
"."
consistently as the regex matching any single character. If there is a reason to treat as an exception, or to do so only for some string functions, should be documented.Output of
pd.show_versions()