<?php
preg_match_all ('/(\w+\,\d+)/', 'M10,18L202,13M23,2L1,1L20,111' ,$result);
print_r($result);