execAll

Summary

Matches the regular expression pattern against some text and returns an array of all matches.

Usage

public string[] execAll(string value)

Returns

An array of all matches. The array will be empty if there were no matches.

Parameters

value

The string to match the regular expression pattern against.

Description

Matches the regular expression pattern against some text and returns all matches in an array. If no matches were found, an empty array is returned.

Differences to JavaScript

Unlike JavaScript, the JS++ exec method never returns null. If no match can be found, exec will return an empty array.

Furthermore, JS++ has been fixed to support the "g" flag for global matching. In JavaScript, the "g" flag is ignored on exec and a global match is not performed.

Examples

Basic Usage
1
2
3
4
5
import System;
 
System.RegExp re = /^abc/;
Console.log(re.execAll("abc")); // ["abc"]
Console.log(re.execAll("xyz")); // []

Share

HTML | BBCode | Direct Link