Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var selection = '$test[0] = 1;'
- var matches = selection.match(/(\d)/g);
- //var matches = selection.match(/[\[|'"](\d)[\]|'|"]/g);
- for (i in matches) {
- number = parseInt(matches[i]);
- selection = selection.replace(matches[i], (number+1));
- trace(matches[i]);
- }
- //ergebnis: $test[2] = 1;
Add Comment
Please, Sign In to add comment