Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  4] [ 1]  / answers: 1 / hits: 28542  / 13 Years ago, mon, october 31, 2011, 12:00:00

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 but the first l I know i can ditch them all and put an 'l' upfront, or I can use substrings. But I'm wondering is there a javascript regexp idiom for this?


More From » regex

 Answers
16

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



/(?!^)l/g


See if online: jsfiddle


[#89355] Saturday, October 29, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
irvinjovannix

Total Points: 416
Total Questions: 94
Total Answers: 117

Location: South Korea
Member since Sun, Aug 8, 2021
3 Years ago
;