@@ -245,6 +245,20 @@ def _str_contains(
245
245
result = result .fill_null (na )
246
246
return self ._convert_bool_result (result )
247
247
248
+ def _str_match (
249
+ self , pat : str , case : bool = True , flags : int = 0 , na : Scalar | None = None
250
+ ):
251
+ if not pat .startswith ("^" ):
252
+ pat = f"^{ pat } "
253
+ return self ._str_contains (pat , case , flags , na , regex = True )
254
+
255
+ def _str_fullmatch (
256
+ self , pat , case : bool = True , flags : int = 0 , na : Scalar | None = None
257
+ ):
258
+ if not pat .endswith ("$" ) or pat .endswith ("\\ $" ):
259
+ pat = f"{ pat } $"
260
+ return self ._str_match (pat , case , flags , na )
261
+
248
262
def _str_find (self , sub : str , start : int = 0 , end : int | None = None ):
249
263
if (
250
264
pa_version_under13p0
@@ -278,17 +292,3 @@ def _str_find(self, sub: str, start: int = 0, end: int | None = None):
278
292
offset_result = pc .add (result , start_offset )
279
293
result = pc .if_else (found , offset_result , - 1 )
280
294
return self ._convert_int_result (result )
281
-
282
- def _str_match (
283
- self , pat : str , case : bool = True , flags : int = 0 , na : Scalar | None = None
284
- ):
285
- if not pat .startswith ("^" ):
286
- pat = f"^{ pat } "
287
- return self ._str_contains (pat , case , flags , na , regex = True )
288
-
289
- def _str_fullmatch (
290
- self , pat , case : bool = True , flags : int = 0 , na : Scalar | None = None
291
- ):
292
- if not pat .endswith ("$" ) or pat .endswith ("\\ $" ):
293
- pat = f"{ pat } $"
294
- return self ._str_match (pat , case , flags , na )
0 commit comments