Method: Polars::StringNameSpace#extract_all

Defined in:
lib/polars/string_name_space.rb

#extract_all(pattern) ⇒ Series

Extracts all matches for the given regex pattern.

Extract each successive non-overlapping regex match in an individual string as an array

Examples:

s = Polars::Series.new("foo", ["123 bla 45 asd", "xyz 678 910t"])
s.str.extract_all('(\d+)')
# =>
# shape: (2,)
# Series: 'foo' [list[str]]
# [
#         ["123", "45"]
#         ["678", "910"]
# ]

Parameters:

  • pattern (String)

    A valid regex pattern

Returns:



577
578
579
# File 'lib/polars/string_name_space.rb', line 577

def extract_all(pattern)
  super
end