I already wrote above thatI know the * means 0 or more occurrences, would [0-9]+ work in this case?
*
does not do what you think. WinSCP file mask is not a regular expression.
See https://winscp.net/eng/docs/file_mask
So
+
won‘t work either. 打算弃用WinSCP,开始使用Filezilla来实现简单的通过正则表达式进行文件名过滤。
虽然WinSCP支持命令行,支持自建脚本,但是那些功能对我来说太高级了,我只想通过正则表达式来过滤文件名这一个单一功能即可。
I already wrote above thatI know the * means 0 or more occurrences, would [0-9]+ work in this case?
*
does not do what you think. +
won‘t work either. Regular expressions are used in filename filters as a way to filter files on either the client or server side.
The flavor of regular expressions used are POSIX extended regular expressions.
The wildcard .
matches any character. For example, a.b
matches any string that contains an "a", then any other character and then "b", a.b
matches any string that contains an "a", and then the character "b" at some later point.
Given regular expressions R and S, the following operations over them are defined to produce regular expressions:
\
. Modern and POSIX extended regexes use metacharacters more often than their literal meaning, so to avoid "backslash-osis" or leaning toothpick syndrome it makes sense to have a metacharacter escape to a literal mode; but starting out, it makes more sense to have the four bracketing metacharacters ( )
and { }
be primarily literal, and "escape" this usual meaning to become metacharacters. Common standards implement both. The usual metacharacters are {}^$.|
+?
and \
. Filezilla应用正则表达式 (RegEx)效果图如下:
Filezilla通过正则表达式 (RegEx) 来过滤文件名
原文:https://www.cnblogs.com/yuguangtai/p/13652999.html