Simple changes in simplified regex and removal of trailing whitespace