"Greediness" has to do with the behavior of the '*' and '+' metacharacters. Because of the greediness of your first '.*', you match the first directory, skip over everything including the second directory and start matching again at option. Using a non-greedy operator would change the behavior, but not fix your problem. You would then start matching at the second directory and everything after that would match.

I do not think it is possible to do what you want with one regex. Why not test for the invalid pattern with one regex. If it is not invalid, test for the valid pattern. Good Luck, Bill