Clean sentences
Posted: Thu Sep 09, 2010 12:40 pm
Hi
Im trying to figure out a good PHP way of cleaning up poorly formatted sentences. A regexp that:
Adds a space after punctuation and ()!?
Adds a space before capital letters, if that capital letter is followed by a lowercase letter (eg "aaaLOTSCAPS" becomes "aaa LOTSCAPS" and "aaaLotsCaps" becomes "aaa Lots Caps")
Any suggestions on available powerful sentence format cleaners out there much welcome!..
Thanks
Im trying to figure out a good PHP way of cleaning up poorly formatted sentences. A regexp that:
Adds a space after punctuation and ()!?
Adds a space before capital letters, if that capital letter is followed by a lowercase letter (eg "aaaLOTSCAPS" becomes "aaa LOTSCAPS" and "aaaLotsCaps" becomes "aaa Lots Caps")
Any suggestions on available powerful sentence format cleaners out there much welcome!..
Thanks