提问人:binks 提问时间:10/29/2023 更新时间:10/29/2023 访问量:60
RexEx 与上一组不匹配
RexEx not matching the last group
问:
我有以下正则表达式
(.*?)(>=|<=|~|!=|=|!~|>|<| IS | IS NOT | WAS | WAS IN | WAS NOT | WAS NOT IN | CHANGED | OR | AND | IN | NOT IN )
它几乎与我所有的测试文本相匹配:
project=blah AND blah=something OR issuetype!="blah" AND someissue IN somefunction("blah") OR blahing <= "something"
它只是与最后一个“某物”字符串不匹配。我明白为什么,但我正在努力在表达式中加入一些东西来捕捉最终值。
答:
0赞
binks
10/29/2023
#1
我认为似乎已经成功了
((.*?)(>=|<=|~|!=|=|!~|>|<| IS | IS NOT | WAS | WAS IN | WAS NOT | WAS NOT IN | CHANGED | OR | AND | IN | NOT IN ))|(.*?)$
评论
| WAS NOT IN |
WAS NOT IN