How to replace all BUT the first occurrence of a pattern in string

后端 未结 6 726
余生分开走
余生分开走 2020-12-03 07:04

quick question: my pattern is an svg string and it looks like l 5 0 l 0 10 l -5 0 l 0 -10 To do some unittest comparison against a reference I need to ditch all

6条回答
  •  春和景丽
    2020-12-03 07:55

    You can try a negative lookahead, avoiding the start of the string:

    /(?!^)l/g
    

    See if online: jsfiddle

提交回复
热议问题