refined the logic of matching
it is not need because regex is smarter now
do normalize for smaller str
better logic
updated the comments