match Summary Finds a substring or matches for a regular expression. Signatures Click on a signature to select it and view its documentation. public string[] match(System.RegExp search) public string[] match(string search) Usage public string[] match(System.RegExp search) public string[] match(string search) Returns An array of all matches. An array of all matches. Parameters search The regular expression to match against the string. Parameters search The substring to search for. Description Matches a regular expression against the string. Finds the first occurrence of a substring. Note that only the first occurrence of a substring will be found. match does not find all occurrences when a string argument is provided. However, match can find all occurrences when a regular expression is provided with the "g" flag. Examples Basic Usage 123456import 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/)); // [] Basic Usage 12345import System; string message = "The quick brown fox jumped again and again.";Console.log(message.match("again")); // [ "again" ]Console.log(message.match("hound")); // [] Share HTML | BBCode | Direct Link