如何在wget中使用正则表达式拒绝文件? [英] How to use regular expressions in wget for rejecting files?

查看:160
本文介绍了如何在wget中使用正则表达式拒绝文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用wget工具下载网站内容.我使用-R选项拒绝某些文件类型.但还有其他一些我不想下载的文件.这些文件的命名如下,没有任何扩展名.

I am trying to download the contents of a website using wget tool. I used -R option to reject some file types. but there are some other files which I don't want to download. These files are named as follows, and don't have any extensions.

string-ID

例如:

newsbrief-02

我如何告诉wget不要下载这些文件(文件名以指定字符串开头的文件)?

How I can tell wget not to download these files (the files which their names start with specified string)?

推荐答案

您不能在 wget -R 键中指定正则表达式,但是可以指定模板(例如外壳).

You can not specify a regular expression in the wget -R key, but you can specify a template (like file template in a shell).

答案如下:

$ wget -R 'newsbrief-*' ...

您还可以使用?和符号类 [] .

You can also use ? and symbol classes [].

有关更多信息,请参见信息wget

这篇关于如何在wget中使用正则表达式拒绝文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆