Salesforce 找出String中所有符合条件的SubString

参考:

https://iwritecrappycode.wordpress.com/2012/06/29/extracting-strings-with-regex-in-salesforce-apex/

Pattern p = Pattern.compile('\\{([^}]*)\\}');  //带括号
// Pattern p = Pattern.compile('(?i)(?m)(?<=\\{).*?(?=\\})');  //不带括号
Matcher m = p.matcher(s);
List<String> apis = new List<String>();
while (m.find()) 
{
    apis.add(m.group());
}
System.debug('获取所有字段'+apis);

你可能感兴趣的:(SalesForce)