Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- d = "M 2 -12 C 5 15 21 19 27 -2 C 17 12 -3 40 5 7"
- tokens = d.split(/[s,]/)
- d = "M2-12C5,15,21,19,27-2C17,12-3,40,5,7"
- tokens = pathdef.split(/(?<=d)(?=D)|(?<=D)(?=d)/)
- [ 'M', '2', '-12', 'C', '5', '15', '21', '19', '27', '-2', 'C', '17', '12', '-3', '40', '5', '7' ]
Add Comment
Please, Sign In to add comment