If you mean to write
> 9, 2, door, close; > 1, 9, door, close; > 3, 3, door, 1, 1;
in one line so you got to fix your regex by removing the ^
and $
totally so this will match
(((?:\s*>\s*[0-9]+\s*,\s*[0-9]+\s*,\s*[a-zA-Z]+\s*(,\s*[a-zA-Z]+\s*)*;\s*)|(?:\s*>\s*[0-9]+\s*,\s*[0-9]+\s*,\s*[a-zA-Z]+\s*,\s*[0-9]+\s*(,\s*[\-]?[0-9]+\s*)*;\s*))+)
In case you mean
> 9, 2, door, close;
> 1, 9, door, close;
> 3, 3, door, 1, 1;
so every one is in a separate line you got to fix your regex by adding the multiline ( /m
or (?m)
) modifier so this will match
(?m)(((?:\s*^>\s*[0-9]+\s*,\s*[0-9]+\s*,\s*[a-zA-Z]+\s*(,\s*[a-zA-Z]+\s*)*;$\s*)|(?:\s*^>\s*[0-9]+\s*,\s*[0-9]+\s*,\s*[a-zA-Z]+\s*,\s*[0-9]+\s*(,\s*[\-]?[0-9]+\s*)*;$\s*))+)
hope this solves your issue