Sep 18, 2015, 2:42 AM
Post #4 of 4
qr/.../ is the quote operator for regular expressions. It basically says: I am not passing an ordinary string, but a regex, and it says to the compiler to compile it as a regex.
Re: [tot94] "qr/\d+.+\.pdf$/ );" what mean ?
[In reply to]
In qr/\d+.+\.pdf$/ ), the first dot is a meta-character that will match any character (except a newline) and will do it any number of times (as any times as possible) because of the + quantifier that follows. The second dot is preceded by a backslash (the escape character), meaning that "\." is meant to match a literal dot ".".
And yes, this expression could catch a file like : 2a.pdf, or 2aa.pdf, 2abc.pdf, 3abdcef.pdf, etc.