Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {{2}([a-zA-Z0-9]+)}{2}
- let questionIndex = 0;
- myString.replace(/{{2}([a-z0-9]+)}{2}/gmi,
- function (fullExpression, matchedGroup1) {
- // NOTE fullExpression is {{abc} for example
- // matchedGroup1 is the 'abc' itself
- questionIndex++;
- return `{{Question ${questionIndex}}}`;
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement