mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 12:22:14 +03:00
6 lines
254 B
JavaScript
6 lines
254 B
JavaScript
const text = "hello\n world";
|
|
const re1 = /(^|[.!?][ \t]+|\n+[ \t]*)([a-z])/g;
|
|
const re3 = /(^|[.!?]\s+|^\s+)([a-z])/gm;
|
|
console.log(text.replace(re1, (m, p, c) => p + c.toUpperCase()));
|
|
console.log(text.replace(re3, (m, p, c) => p + c.toUpperCase()));
|