Update index.php

Regex to handle when whites spaces, trailing semicolon are present in the input.
Merge pull request #44 from Bhanudev/patch-2

Update index.php