I want to change my text in lowerCase but keep the first letter of each sentense uppercase.
Input
LOREM Ipsum is simply DUMMY text of the printing and typesetting industry. Lorem IPSUM. Has been the industry's standard dummy text ever since the 1500s, WHEN an unknown printer took a galley.
Expected
Lorem ipsum is simply dummy text of the printing and typesetting industry. Lorem ipsum. Has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley.
I am new to regexp, I tried this :
expected = input.replace(/([A-Z])+/g, "\$&".toLowerCase())