match

Summary

Finds a substring or matches for a regular expression.

Signatures

Click on a signature to select it and view its documentation.

Usage

public string[] match(System.RegExp search)

Returns

An array of all matches.

Parameters

search

The regular expression to match against the string.

Description

Matches a regular expression against the string.

Examples

Basic Usage
1
2
3
4
5
6
import System;
 
string message = "The quick brown fox jumped again and again.";
Console.log(message.match(/again/));  // [ "again" ]
Console.log(message.match(/again/g)); // [ "again", "again" ]
Console.log(message.match(/hound/));  // []

Share

HTML | BBCode | Direct Link