There is a string having the following pattern
Part1 : Part2
Part1 is a string without any “space” inside it, or this string can include anything except “space”. Part2 is another string which can have “space” inside. Between Part1 and Part2, the separator is “space””:””space”, ie, : How to write a regular expression to capture Part1. Thanks.
(\w+)\s:\s.*
您可以在以下网站上查看正则表达式: https : //regex101.com/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.