【发布时间】:2012-05-17 10:51:03
【问题描述】:
我有数千个 jpg 文件,它们都称为 1.jpg、2.jpg、3.jpg 等等。我需要压缩它们的范围,我想我可以用正则表达式来做到这一点,但到目前为止还没有任何运气。
这里是命令
zip images.zip '[66895-105515]'.jpg
有人有什么想法吗?
【问题讨论】:
-
由于正则表达式只匹配字符,所以根据字符匹配数字范围的正则表达式会特别的怪物! (6(6(89[5-9]|9[0-9]{2})|[7-9][0-9]{3})|[7-9][0-9]{4 }|10([0-4][0-9]{3}|5([0-4][0-9]{2}|5(0[0-9]|1[0-5]) ))) 在您的情况下,您的正则表达式所说的是:
[ # Match any of the following characters:6689 # Any of these characters5-1 # Or anything in the ascii range of the character '5' to the character '1'05515 # Or any of these characters]编辑:呃,格式化:(
标签: regex linux command-line zip