Simple, self-explanatory code snippets.
let str = 'abc def SOMETHING_TO_LOOK_FOR 12';
str = str.replace(
/(.*)SOMETHING_TO_LOOK_FOR ([0-9]{1,})(.*)/
, "$1 ANY_OTHER_TEXT $2 $3"
);
console.log(str);
No comments:
Post a Comment