This is my pattern:
^~[0-9]+@Y 1,710,-?[0-9]+[,-?[0-9]+]*\n$
For some reason it's match :~01@Y 1,710,9,
But not: ~01@Y 1,710,9
I don't understand why it's need the last comma?
This is my pattern:
^~[0-9]+@Y 1,710,-?[0-9]+[,-?[0-9]+]*\n$
For some reason it's match :~01@Y 1,710,9,
But not: ~01@Y 1,710,9
I don't understand why it's need the last comma?
I think the problem here is
[,-?[0-9]+]*
It will match "~01@Y 1,710,9,"
or "~01@Y 1,710,[9]"
If you just want to define your expression match with comma, question mark, number or "-" at the end, you can try expression below:
^~[0-9]+@Y 1,710,-?[0-9]+[,?0-9-]*$