Advertisement
Guest User

Untitled

a guest
May 31st, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. {{2}([a-zA-Z0-9]+)}{2}
  2.  
  3. let questionIndex = 0;
  4. myString.replace(/{{2}([a-z0-9]+)}{2}/gmi,
  5. function (fullExpression, matchedGroup1) {
  6. // NOTE fullExpression is {{abc} for example
  7. // matchedGroup1 is the 'abc' itself
  8.  
  9. questionIndex++;
  10.  
  11. return `{{Question ${questionIndex}}}`;
  12. }
  13. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement