使用notepad ++从html中选择一些文本(select some text from html using notepad++)

编程入门 行业动态 更新时间:2024-10-25 12:18:06
使用notepad ++从html中选择一些文本(select some text from html using notepad++)

我已经认识到来自html的一些文本模式。 我想从波纹管中提取一些文字:

function OnerMobilePlayer_getPlaylist() { var playlist = eval("(" + '["\/ezfiles\/0\/1000\/plugin\/oner\/radios\/32\/20332\/movie_862b1a03d03ed7e602a66d2c9bbe8585.mp4","\/ezfiles\/0\/1000\/plugin\/oner\/radios\/33\/20333\/movie_710e022071e07af283add78ff1847c55.mp4","\/ezfiles\/0\/1000\/plugin\/oner\/radios\/34\/20334\/movie_6113ff40bd75188e45a3fe6d782553c8.mp4","\/ezfiles\/0\/1000\/plugin\/oner\/radios\/35\/20335\/movie_eddd31fc1b3a3938ef76ed02cadafa71.mp4","\/ezfiles\/0\/1000\/plugin\/oner\/radios\/36\/20336\/movie_cbdd83c530ce906023848366f3ebd2d5.mp4","\/ezfiles\/0\/1000\/plugin\/oner\/radios\/37\/20337\/movie_f7c2da1b186f9731ecc8fdb50928e209.mp4","\/ezfiles\/0\/1000\/plugin\/oner\/radios\/38\/20338\/movie_3c0f2f3da72e990b9755e41a99a4a9cc.mp4"]' + ")"); return playlist;

我想提取的结果就像

/32/20332/movie_862b1a03d03ed7e602a66d2c9bbe8585.mp4 /33/20333/movie_710e022071e07af283add78ff1847c55.mp4 ...

我想知道是否有有效的方法来使用记事本++从原始的HTML代码中提取所需的文本。

伟大的thx提前。

i have recognized some text pattern from html. i want to extract some text from bellow:

function OnerMobilePlayer_getPlaylist() { var playlist = eval("(" + '["\/ezfiles\/0\/1000\/plugin\/oner\/radios\/32\/20332\/movie_862b1a03d03ed7e602a66d2c9bbe8585.mp4","\/ezfiles\/0\/1000\/plugin\/oner\/radios\/33\/20333\/movie_710e022071e07af283add78ff1847c55.mp4","\/ezfiles\/0\/1000\/plugin\/oner\/radios\/34\/20334\/movie_6113ff40bd75188e45a3fe6d782553c8.mp4","\/ezfiles\/0\/1000\/plugin\/oner\/radios\/35\/20335\/movie_eddd31fc1b3a3938ef76ed02cadafa71.mp4","\/ezfiles\/0\/1000\/plugin\/oner\/radios\/36\/20336\/movie_cbdd83c530ce906023848366f3ebd2d5.mp4","\/ezfiles\/0\/1000\/plugin\/oner\/radios\/37\/20337\/movie_f7c2da1b186f9731ecc8fdb50928e209.mp4","\/ezfiles\/0\/1000\/plugin\/oner\/radios\/38\/20338\/movie_3c0f2f3da72e990b9755e41a99a4a9cc.mp4"]' + ")"); return playlist;

the result i want to extract is like

/32/20332/movie_862b1a03d03ed7e602a66d2c9bbe8585.mp4 /33/20333/movie_710e022071e07af283add78ff1847c55.mp4 ...

i was wondering if there are efficient ways to extract the desired text from original html code using notepad++.

great thx in advance.

最满意答案

你可以用几个正则表达式来完成查找/替换:

步骤1

像这样做一个正则表达式查找/替换:

打开替换对话框 Find What: .*\[([^\]]+)\]+.* 替换为: \1 检查正则表达式 匹配换行符 单击替换或全部替换

现在你有文件列表。

第2步

像这样做一个正则表达式查找/替换:

打开替换对话框 寻找什么: "?\\/ 替换为: / 检查正则表达式 单击替换或全部替换

现在我们已经修复了路径分隔符并删除了前导引号。

第3步

像这样做一个正则表达式查找/替换:

打开替换对话框 寻找什么: ",? 替换为: \n ,您可能希望在Windows上使用\r\n 。 检查正则表达式 单击替换或全部替换

最后我们删除了尾部的引号,并用换行符替换了逗号。

You can do it with several regular expression Find/Replaces :

Step 1

Do a regular expression find/replace like this:

Open Replace Dialog Find What: .*\[([^\]]+)\]+.* Replace With: \1 Check regular expression and . matches newline Click Replace or Replace All

Now you have the List of files.

Step 2

Do a regular expression find/replace like this:

Open Replace Dialog Find What: "?\\/ Replace With: / Check regular expression Click Replace or Replace All

Now we have fixed the path separator and removed the leading quote.

Step 3

Do a regular expression find/replace like this:

Open Replace Dialog Find What: ",? Replace With: \n , you might want to use \r\n on windows. Check regular expression Click Replace or Replace All

And finally we have removed the trailing quote and replaced the comma with newlines.

更多推荐

本文发布于:2023-08-05 23:06:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1441142.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本   html   notepad   select   text

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!