Qu

regex_split

Builtin index · Collections & strings

result = regex_split(s, pattern)

Input: s, pattern · Output: result

What it is

s and pattern are Strs.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = regex_split(s, pattern)
s Strnot documented yet
pattern Strnot documented yet
result List or Str
Returns a List of Str, split on every match of the pattern.

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

s = "sensor_1: 12.4, sensor_2: 9.8, sensor_3: 15.0"
print(regex_match(s, "sensor_[0-9]+"))    # true

print(regex_find(s, "[0-9]+\.[0-9]+"))    # "12.4"

print(regex_split(s, ", *"))              # 3-piece split on each comma

print(regex_count(s, "sensor_"))          # 3

output
true
12.4
("sensor_1: 12.4", "sensor_2: 9.8", "sensor_3: 15.0")
3

from collections-strings