You may use:
^CTC\sN\+(?:123\d{9}|\d{10,12})\/?(EN|FR)?$
Demo.
The relevant part (i.e., (?:123\d{9}|\d{10,12})
) will match either "123" followed by 9 digits (for a total of 12 in Regex2) or between 10 and 12 digits (from Regex1).
Note that unless you want to capture "EN" and "FR" separately, you may convert the capturing group into a non-capturing one (i.e., (?:EN|FR)
).
One more thing to be aware of is that if the number starts with "123" and has a length <12 (10 or 11), it will still be a valid match (because it satisfies the \d{10,12}
part from Regex1). If you need to prevent that (and assuming your regex flavor supports Lookaheads), you may use:
^CTC\sN\+(?:123\d{9}|(?!123)\d{10,12})\/?(EN|FR)?$
Demo.
References: