Home Cooker Classes Others Rice CookerGX
Classes  >  regex  >  Matches(string)
regex class : Matches(string) method

Description

Gets a list of all substrings in the input string which matches with the regular expression.

Syntax

regexInstance.Matches(string source)

Arguments

ClassNameDescription
stringsourceA string which is searched.

Return value

ClassDescription
list{string}A list of all substrings in the input string which matches with the regular expression.

Sample code

//anyRegex is an any instance of regex type.

regex anyRegex = new regex("(a+)");

list{string} matches = anyRegex.Matches("aaabbbaaccc");

Notes

It's a wrapper of the System.Text.RegularExpressions.Regex.Matches(String).

Links for reference

Copyright © Rice All rights reserved.