MyMovie1967.mkv
MyMovie (1967).avi
I thought that this search might do what I need, but this also returns files with the year in parentheses.
(^.+)((\([012345679]{4}\)){0})

Any help would be greatly appreciated.

Code: Select all
regex:^.*[^\(][12][0-9]{3}[^\(].*
Code: Select all
regex:^.*[^(0-9)\(][12][0-9]{3}[^(0-9)\)].*


Code: Select all
!regex:\(\d\d\d\d\)
Because it's name also includes a 4 digit number that *isn't* enclosed by (): 2049NeonLadder wrote:That expression returns what I believe is the list of files I need!
I am curious as to why this file is included
That would also match "Hello World.txt", I think.therube wrote:Files that don't have 4 digits enclosed in parens.
That way it can include your movies from the 1700's tooCode: Select all
!regex:\(\d\d\d\d\).
NotNull, try this, literals will work:NotNull wrote:Code: Select all
regex:^.*[^(0-9)\(][12][0-9]{3}[^(0-9)\)].*
Code: Select all
regex:[()]Hey, that works too! I had no idea .. Nice catch!Stamimail wrote:NotNull, try this, literals will work:NotNull wrote:Code: Select all
regex:^.*[^(0-9)\(][12][0-9]{3}[^(0-9)\)].*I'm just learning now some Regex, and I didn't understand why you tried to escape by "\"Code: Select all
regex:[()]
Do you know Regex flavor needs "\" ?
From http://www.regular-expressions.info/charclass.htmlwww.regular-expressions.info
"In most regex flavors, the only special characters or metacharacters inside a character class are the closing bracket ], the backslash \, the caret ^, and the hyphen -. The usual metacharacters are normal characters inside a character class, and do not need to be escaped by a backslash. To search for a star or plus, use [+*]. Your regex will work fine if you escape the regular metacharacters inside a character class, but doing so significantly reduces readability.
In most regex flavors, the only special characters or metacharacters inside a character class are the closing bracket ], the backslash \, the caret ^, and the hyphen -. The usual metacharacters are normal characters inside a character class, and do not need to be escaped by a backslash. To search for a star or plus, use [+*]. Your regex will work fine if you escape the regular metacharacters inside a character class, but doing so significantly reduces readability.
To include a backslash as a character without any special meaning inside a character class, you have to escape it with another backslash. [\\x] matches a backslash or an x. The closing bracket ], the caret ^ and the hyphen - can be included by escaping them with a backslash, or by placing them in a position where they do not take on their special meaning. The POSIX and GNU flavors are an exception. They treat backslashes in character classes as literal characters. So with these flavors, you can't escape anything in character classes.