Capy-Bearer Documentation

regex_split

host call

Capy

function regex_split(pattern : string, subject : string, opt : any = {}) any

Description

regex_split() removes separators and keeps empty parts. opt.flags takes the flag letters described for regex_match().

Parameters

pattern : regular expression separator

subject : text to split

opt : options map with flags

Return Values

A list of text parts.

Example

Capy

var parts := regex_split(",", "a,,b")
print(parts[1], "\n")

Output