Guest User

Untitled

a guest
Dec 13th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. d = "M 2 -12 C 5 15 21 19 27 -2 C 17 12 -3 40 5 7"
  2. tokens = d.split(/[s,]/)
  3.  
  4. d = "M2-12C5,15,21,19,27-2C17,12-3,40,5,7"
  5.  
  6. tokens = pathdef.split(/(?<=d)(?=D)|(?<=D)(?=d)/)
  7.  
  8. [ '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