What does regular\ b mean?

var num = "1234567.89";
var num1 = num.replace(/(?<=\d)(?=(\d{3})+\b)/g, ",");    
// \b   1,234,567.89

var num2 = num.replace(/(?<=\d)(?=(\d{3}))/g, ",");
// \b   1,2,3,4,567.89

\b 
\b

regular expression testing tool


. This kind of question, can you check the official api? You should be ashamed to ask such a question. B and b are both word boundary matchers

.
Menu