I need to validate that the text input in my rails form has contains one or more alphanumerics with specific format separated by comma.
For example the alphanumeric should be either two letters + seven numbers + one letter + one number
or two letters + 11 numbers + one letter + one number
. And these alphanumerics must be separated by comma (,)
US6174724B1 , US20010002490A1 (This is a valid one)
ruby , rails (This is an invalid one)
How can I build a ruby regular expression that checks if (these alphanumerics have specific format) AND if (they are separated by comma)