Guest User

Untitled

a guest
Jul 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. var selection = '$test[0] = 1;'
  2. var matches = selection.match(/(\d)/g);
  3. //var matches = selection.match(/[\[|'"](\d)[\]|'|"]/g);
  4. for (i in matches) {
  5. number = parseInt(matches[i]);
  6. selection = selection.replace(matches[i], (number+1));
  7. trace(matches[i]);
  8. }
  9. //ergebnis: $test[2] = 1;
Add Comment
Please, Sign In to add comment