Patterns #1 and #4 (ignoring your comment that there are "...3 'pattern'. ") are almost the same and can be handled by
\d{5}[A-Z\d]
(possibly with the "ignore case" option set if you can allow lower case letters) Also I assume that the last character in Pattern #1 should be a letter (as per your example and not as per your statement). This matches 5 digits and then a letter or a digit.
Pattern #2 is
0N\d{4}
Pattern #3 can be expressed as:
C\d{4}[A-Z]
(again with the "ignore case" option set if necessary)
To put these together you use the alternation operator. Also to force the pattern to match the entire input (so you don't match the 6 digits in "AB123456E") you use anchors at each end to give
^(\d{5}[A-Z\d]|0N\d{4}|C\d{4}[A-Z])$
In this case the order of the alternates does not really matter. The alternates are tested in the order they are written in the pattern and so a value that matches pattern #2 will first be tried against the 'd{5}' part of the first alternate. It will match the '0' but fail on the 'N' and so move on to the 2nd alternate where it will match.
I have not tested these pattern but they should give you a good starting point.
As for learning how to do this, I suggest that you Google "regex tutorial" and start reading. As each regex variant has its own characteristics, you may want to add in "javascript" to the search string.
Susan