Extract absolute path operation from SVG data value

I have the following d attribute for SVG but the question is about regular expression :


I’m looking for a way to get the blocks that has capital and a series of number so the result array should be [M772.333,347.86, V296.139, L772.333,347.86]

The pattern [A-Z]?[0-9.,] gives capitals and the numbers next to it but as well as the numbers after lowercase letters. I’d like to get rid of the numbers after lowercase letters.

Thank you,

This is a simpler and yet elegant method : [A-Z][0-9.,]+

I found a solution to my question.

(?![0-9,-.])[A-Z]?[0-9.,]+ is the pattern that finds the required capital and number groups.