如何通过匹配已知的关键字集来提取子字符串)

例如,尝试在特定代码后提取子字符串

String sample1 = "/ASDF/096/GHJKL/WER/WER/dv/7906/CODEM/TEAR1331927498xxxxxx/YUII/OPL";
String sample2 = "/CODEM/TEAR1331927498xxxxxx";

String regExpresssion = "[/CODEM/]{6}(^[a-zA-Z0-9|\\s])?";
final Pattern pattern = Pattern.compile(regExpresssion);
final Matcher matcher = pattern.matcher(sample1);
if (matcher.find()) {
  String subStringOut = sample1.substring(matcher.end());
}

subStringOut for sample 1  > TEAR1331927498xxxxxx/YUII/OPL
subStringOut for sample 2  > TEAR1331927498xxxxxx

上面的代码工作正常,但现在我需要在正则表达式中为下面的示例添加一个标识符'/ CODER /'

String sample3 = "/ASDF/096/GHJKL/WER/WER/dv/7906/CODER/TEAR1331927498xxxxxx/YUII/OPL";

我努力了

String regExpresssion = "[/CODEM/|/CODER/]{6}(^[a-zA-Z0-9|\\s])?"; 

但它不起作用。有什么建议吗?

谢谢!!