62,567
社区成员




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
*/