Added optional parameter support...

-simplified regex pattern
-added unit tests
-improved whitespace support