(I'm not particularly good or knowledgeable at this stuff...)
? is the non-greedy part.
greedy:
(.*)(\()
Matches: The Straight Story (1999) (
non-greedy:
(.*?)(\()
Matches: The Straight Story (
I guess the ? in (.*?) tells the function to eat everything until the next described condition, which in this case is (\s\(.*) or space followed by a "(" followed by anything else (.*). Is that so?
That sound right to me.
Maybe you put the (\s\(.*) outside the (.*?) to delimit a 3rd group, to the sort it with the /3?
Well the \s is outside if everything, IOW it gets "eaten".
If it weren't eaten, you'd have an extra <sp> that you'd have to deal with.
When you set up your Replace: part, you can always add a <sp> (or whatever) in there as needed.
And as always, there is likely to be multiple way to accomplish the same goal.
As such, using the expression (.*?) should always be followed by another condition. Correct?
Not sure particularly, but I'd think it will just depend on the entire context?
why do you find (\s\(\d\d\d\d\).*) to be more succinct? Since I know that the date always comes after the title
"Since I know", so in your case, you may not need it.
As it is, I searched for a <sp>(, which is rather generalized.
Finds:
The Straight Story (1999)
and also:
The Straight Story (did you really intend on finding me?)
By adding the \d\d\d\d\, it will match the first but not the second.
Likewise it would also find:
The Straight Story (1999) (Happens to be the song playing at the moment.)