100分。关于字符串的正则表达式。
有如下字符串:
“GET /imagegenerator?type=flow&resource=123 HTTP/1.1”
我想提取 GET 和 HTTP/1.1之间的内容。
正则表达式该如何写?
如果我想匹配 /imagegenerator?type=flow&resource=123 这个字符串格式,
正则表达式该如何写?
非常感谢!
“GET /imagegenerator?type=flow&resource=123 HTTP/1.1”
我想提取 GET 和 HTTP/1.1之间的内容。
正则表达式该如何写?
如果我想匹配 /imagegenerator?type=flow&resource=123 这个字符串格式,
正则表达式该如何写?
非常感谢!
作者: chenzhp 发布时间: 2011-05-11
sed -e 's/.*GET \(.*\) HTTP.*/\1/' filename
作者: steptodream 发布时间: 2011-05-11
^GET
$HTTP/1.1
/imagegenerator?type=flow&resource=123\{1\}
$HTTP/1.1
/imagegenerator?type=flow&resource=123\{1\}
作者: wjw_scence 发布时间: 2011-05-11
str.split('""')|cut -d" " -f2
作者: lgxwqq111 发布时间: 2011-05-11