Regex - astromechanic/cheat_sheets GitHub Wiki
Example of Regex in Apex
Pattern accountIdPattern = Pattern.compile('001.{15}');
Matcher accountIdMatcher = accountIdPattern.matcher(request.requestURI);
Id accountId;
if (accountIdMatcher.find()) {
accountId = accountIdMatcher.group();
}