您可以将数据与正则表达式进行比较,如果它们匹配,则知道数据是有效的。
You can compare data to a regular expression; if they match, you know your data is valid.
它还支持对添加的文件进行过滤,方法是使用文件的正则表达式模式传递第二个参数,以匹配文件并添加到归档中。
It also supports filtering of the files to add by passing a second parameter with the regular-expression pattern of files to match and add to the archive.
比方说你不会试图去扩展正则表达式来设计HTML页面,也不会用CSS来进行文本匹配。
You don't want to extend regular expressions to style HTML, nor CSS to match text patterns.
应用推荐