change regex pattern to public for testing
add some comments
add some unit tests