I'm trying to validate text in a text area. (I will eventually be using an Angular 9 pattern validator with this regex). Can you help me with the regex?
Text will be 1 to N pairs of alphanumeric characters separated by commas, with new lines at the end of each pair. Spaces before or after each alphanumeric don't matter.
Example data (I don't know how to represent the newline in the blockquotes):
TEST12345, R5045876
EUDONOT1234, EF2345Y
AB345EEI2,FT0123
Here's what I have tried for Regex in RegExr which seems to pass, but I can't seem to get it to work as my pattern string.
[ ]?[a-zAZ0-9](?:,[a-zA-Z0-9])*$