I have a string. I want to use regular matching to find out the time in the log. The string is
.INFO: 2018-12-05 13:49:31 ip[10.26.100.4] token[18167782963] [application] Jupiter http://i.jupiter.baidu.com/api/tags/info?cate_id=530&sort=-weight postData:[] "Jupiter.url"
I use
(?<=^(\w+:\s)).{19}(?=\s)
can match 13:49:31 on 2018-12-05. But my string becomes
web11-online.mars.baidu.com INFO: 2018-12-05 13:49:31 ip[10.26.100.4] token[18167782963] [application] Jupiter http://i.jupiter.baidu.com/api/tags/info?cate_id=530&sort=-weight postData:[] "Jupiter.url"
that is, there is an extra
in front of it.web11-online.mars.baidu.com
If you use the above rule again, it won"t match. Which god can tell me why and give me a regular expression that can match? thank you .