Improve regex. Remove unnecessary trim()s. Avoid try-catch.
Merge pull request #17 from shockone/refactoring

Improve regex. Remove unnecessary trim()s. Avoid try-catch.