regex greedy match ends with character or end of string
This question already has an answer here:
You could do:
^(?P<action>S+)
(?P<target_object_label>.+)s
(?P<object_type>Owner Sharing Rule)s
(?P<object_label>[^:n]+) # stop before : or newline
See a demo on regex101.com (mind the different modifiers!).
链接地址: http://www.djcxy.com/p/76972.html下一篇: 正则表达式贪婪匹配以字符或字符串结尾结束