我已经认识到来自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 AllNow 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 AllNow 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 AllAnd finally we have removed the trailing quote and replaced the comma with newlines.
更多推荐
发布评论