11223342124 11223342124 - 4 months ago 52
Javascript Question

Matrix validation format

I am making page for matrix multiplication and I need to validate those matrices. Currently I have regex that accepts this format:

but it should accept this as well:


What should I do? How it can match single array and group of them too?


I assume you want something like this:


To match all these:


Regex 101 here: https://regex101.com/r/tsS0G3/3