我需要从不在括号内的最后一个前导(字首)大写字母到字符串末尾的子字符串
我尝试使用这个正则表达式:
([A-Z][a-zA-Z\-\']*\s*)*(\s+\([^)]*\)[\s]*)+$
匹配这个输入:
can This Be PosSible (Ignore aNy Upper CAse in parenthesis)
匹配是:
This Be PosSible (Ignore aNy Upper CAse in parenthesis)
但期望的输出是:
PosSible (Ignore aNy Upper CAse in parenthesis)
参见 this on regex101 .
最佳答案
关于java - 匹配从最后一个不在括号中的大写字母单词开始到字符串末尾的子串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31251256/