62,624
社区成员
![](https://csdnimg.cn/release/cmsfe/public/img/topic.427195d5.png)
![](https://csdnimg.cn/release/cmsfe/public/img/me.40a70ab0.png)
![](https://csdnimg.cn/release/cmsfe/public/img/task.87b52881.png)
![](https://csdnimg.cn/release/cmsfe/public/img/share-circle.3e0b7822.png)
String test = "IS_HOLIDAY('10/01/2009','CAD', 'us holidsy', 'test')";
String regex = "\\'(.*?)\\'";
Matcher m = Pattern.compile(regex).matcher(test);
while (m.find()) {
System.out.println(m.group(1));
}
String test = " IS_HOLIDAY('10/01/2009','CAD', 'us holidsy', 'test')";
String pattern = "(?i)IS_HOLIDAY\\(\\s*'([^']*)'\\s*,\\s*'([^']*)'\\s*,\\s*'([^']*)'\\s*,\\s*'([^']*)'\\)";
Matcher m = Pattern.compile(pattern).matcher(test);
if(m.find())
{
System.out.println(m.group(1));
System.out.println(m.group(2));
System.out.println(m.group(3));
System.out.println(m.group(4));
}
string test = "IS_HOLIDAY('10/01/2009','CAD', 'us holidsy', 'test')";
Regex reg = new Regex(@"(?i)IS_HOLIDAY\((?:(?:\s*,\s*)?'([^']*)')+\s*\)");
Match m = reg.Match(test);
foreach(Capture c in m.Groups[1].Captures)
{
richTextBox2.Text += c.Value + "\n";
}
/*-------输出---------
10/01/2009
CAD
us holidsy
test
*/