Extracted from Pike v8.0 release 164 as of 2018-07-18.
   

Method Regexp.PCRE.Plain()->split2()


Method split2

array(string)|int(0..0) split2(string subject, void|int startoffset)

Description

Matches a subject against the pattern, returns an array where the first element are the whole match, and the subsequent are the matching subpatterns. Returns 0 if there was no match.

example:

> Regexp.PCRE.Plain("i\(.*\) is \(.*\)u")->split2("pike is fun"); Result: ({ "ike is fu", "ke", "f" })