Salesforce Developer Regex

salesforce-developer

Pattern p = Pattern.compile('/Accounts/(.+)/contacts');
Matcher matcher = p.matcher(request.requestURI + '');
matcher.find();
System.debug('Match count:' + matcher.groupCount());
String accountId = matcher.group(1);

System.debug('Account ID from test:' + accountId);

String str;
str.replaceAll('[^\w]','');
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License