With regular expressions you could possibly use something like:
[12];(\d){8,9}
Another option would be to split the text based on the semicolon and check that there are two return elements, the first one has number 1 or 2 and the second one is integer. Methods to use with this would be:
-
String.Split[
^]
-
Int32.TryParse[
^]