有两个字符串:
XXXXXX编制单位:万科企业股份有限公司 单位:元
只想要匹配到第二个字符串,如何对字符串取反,即对“编制”取反,还有“投资”等词语也不能匹配到。
网上搜索一通都是对“字符”取反的......
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
Because the label has python,我就说说python right
python
In fact, I don’t quite understand your purpose. I vaguely feel that the function you want is not the opposite,
If you just want to capture a certain part of the clauses in the regular expression, you can use 分组捕获
分组捕获
If you really want it取反,就用negative lookahead assertion,比如(?!投资)
取反
negative lookahead assertion
(?!投资)
If it is Java的话,你自己上网搜搜negative lookahead assertion在Javahow to use it, it should be almost the same
Java
Because the label has
python
,我就说说python
rightIn fact, I don’t quite understand your purpose. I vaguely feel that the function you want is not the opposite,
If you just want to capture a certain part of the clauses in the regular expression, you can use
分组捕获
If you really want it
取反
,就用negative lookahead assertion
,比如(?!投资)
If it is
Java
的话,你自己上网搜搜negative lookahead assertion
在Java
how to use it, it should be almost the same