简体   繁体   English

在 Notepad++ 中查找和替换以跟踪 URL

[英]Find and Replace to track URLs in Notepad++

I have a file that contains around thousands of lines.我有一个包含大约数千行的文件。 Format of every line is as below:每行的格式如下:

02:17:15.204    1.217   890 322 GET 200 text/html   http://stage.youbeauty.com/body-fitness/galleries/gluten-free-bodycare
02:17:16.530    0.304   313 (7592)  GET (Cache) text/javascript http://use.typekit.com/lqi6pyj.js
02:17:16.534    0.769   463 (8631)  GET 304 text/css    http://stage.assets0.youbeauty.com/rel-20120404171521/assets/vendor.css
02:17:16.537    1.514   419 32963   GET 200 text/css    http://stage.assets0.youbeauty.com/rel-20120404171521/assets/application1.css

I want to get only the URLs with the help of "Find and Replace" functionality in NOtepad++.我只想借助 NOtepad++ 中的“查找和替换”功能获取 URL。

(It is also fine if we use any script like java script ) (如果我们使用任何脚本也可以,例如 java 脚本)

Use the Regular Expression option, and this search term:使用正则表达式选项和这个搜索词:

http.*

This will select everything from the http to the end of the line.这将 select 从http到行尾的所有内容。

If you want to remove everything but the URL on each line, use this:如果要删除每一行中除 URL 以外的所有内容,请使用以下命令:

Find what: .*(http.*)
Replace with: \1

I have written a python script.我写了一个 python 脚本。 Here it is http://ideone.com/TkK5e .这是http://ideone.com/TkK5e Hope it helps.希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM