当前位置:网站首页>C regular expression

C regular expression

2022-06-12 15:59:00 Sunshine in front of heart

file

Official documents

Common static methods

Regex.IsMatch(input, regular) Judge input match regular
Regex.Match(input, regular) Return to match regular One of the first Match
Regex.Matches(input, regular) Return to match regular The multiple Match

example

string delimited = "[^a-x]";
string input = "abcdefghijklmnopqrstuvwxyz";
Debug.Log(Regex.IsMatch(input, delimited));// Judge whether it matches  true
Debug.Log(" Single :" + Regex.Match(input, delimited));// Single match result  y
foreach (Match match in Regex.Matches(input, delimited))// Multiple matching results 
{
    
    Debug.Log(" Match results :" + match.Value);//y z
}
原网站

版权声明
本文为[Sunshine in front of heart]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202281729029312.html