ENH: Allow regex matching in fullmatch
mode
#32806
Labels
API - Consistency
Internal Consistency of API/Behavior
Strings
String extension data type and string data
Milestone
Problem description
Series.str
contains methods for all the regular expression matching modes in there
package except forre.fullmatch()
.fullmatch
only returns matches that cover the entire input string, unlikematch
, which also returns matches that start at the beginning of the string but do not cover the complete string.One can work around the lack of
fullmatch
by round-tripping to/from numpy arrays and usingnp.vectorize
, i.e.but it would be more convenient for users if
fullmatch
was built in.The
fullmatch
method was added to there
package in Python 3.4. I think that the reason this method wasn't in previous versions of Pandas was that older versions of Python don't havere.fullmatch
. As of Pandas 1.0, all the supported versions of Python now havefullmatch
.I have a pull request ready that adds this functionality. After my changes, the
Series.str
namespace gets a new methodfullmatch
that evaluatesre.fullmatch
over the series. For example:[Edit: Simplified the workaround]
The text was updated successfully, but these errors were encountered: