JSFiddle - React, Tailwind, and code Playground
JavaScript
var path = "L34,52L29,1003L342,234";
var ptrn = RegExp(/L\d+,\d+/);
document.write(ptrn.exec(path));
var path = "L34,52L29,1003L342,234";
var ptrn = RegExp(/L\d+,\d+/);
document.write(ptrn.exec(path));