Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.log( 'test -test- !test!'.replace(/\btest\b/g, '1234') );
- // 1234 -1234- !1234!
- console.log( '0test5 atestb _test_ test'.replace(/\btest\b/g, '1234') );
- // 0test5 atestb _test_ 1234
- console.log( 'test -test- !test!'.replace(/\Btest\B/g, '1234') );
- // test -test- !test!
- console.log( '0test5 atestb _test_ test'.replace(/\Btest\B/g, '1234') );
- // 012345 a1234b _1234_ test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement