I came up with this kind of RegExp:
var rg = /(^w{1}|.s*w{1})/gi;
var myString = "hi all, this is derp. thank you all to answer my query.";
myString = myString.replace(rg, function(toReplace) {
return toReplace.toUpperCase();
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…