Added comments and few more unit tests
Added functional test for post regex matching