Regex — API reference
0/1 types documented. Of 6 public methods, 1 carry their own description, 0 are covered by their type's, and 5 have neither. An entry with no prose below its signature is undocumented in the source, not undocumented here.
CLASS Regex
Regex/src/Regex.ev:26
Fields
String sourceString flagsint64 handle
Constructors
INIT(String pattern, String flagStr)
Methods
METHOD match(String input) RETURNS boolean
METHOD replace(String input, String replacement) RETURNS String
METHOD captureGroup(String input, int32 groupIndex) RETURNS | String
Capture group groupIndex of the first match in input (group 0 is
the whole match). Pipe-XOR: SUCCESS yields the captured substring;
FAILURE when the pattern does not match or the group index is out of
range.
The native returns nullptr on no-match / bad-index, which now marshals
to the PRESENT empty string (a String is never EMPTY — I.D.vii.b, so
the old IS VALID test is E6068). Absent a companion presence FFI (as
System.getenv uses ev_env_has), no-match is read as an empty result.
KNOWN LIMITATION: a group that legitimately matches the empty string is
therefore reported as FAILURE — acceptable for the current surface;
distinguishing the two would need an ev_regex_* presence native
(module rule: needs sign-off).
MODIFY METHOD close() RETURNS void
METHOD getSource() RETURNS String
METHOD getError() RETURNS String