You're using regular expressions wrong. You should use regexes to match Strings with a given regex, not to test regexes against each other.
A regex represents a set of possible matches: (.)01
matches a01
, 301
, $01
, etc, etc...
So, doing this makes sense when you match one item from that set, eg.$01
back against the regex.
In your last case, you're attempting to match a regex with a regex, which is just silly. Which regex is your source and which String is your target? If the first regex is your source, 201
matches it, but also 101
, #01
, etc... But this is not right according to the second regex, which matches items like 201
, but also 2#1
and 291
. So they should not be considered 'matching each other'.
Take a look at this Venn Diagram:

Your last regex match-up has two regexes fighting each other.
The first regex is represented by circle A. The second regex is represented by circle B.
There are elements (well, just 201
) which are/is both in circle A and circle B (pointed out by the darker colored both A & B
). Would you consider these circles to be matching? I certainly don't. I would if they covered each other exactly.
But the only way for these circles to cover each other exactly (meaning everything in circle A is in circle B and everything in circle B is in circle A), is if both regexes are completely the same! Like (.)01
and...... (.)01
! This is the only possible match, but if you're treating one like a regex and one like a String, it still won't work.
EDIT If you just want to find whether this is at least one common match, this can be helpful: https://stackoverflow.com/a/17957180/1283166