Disable whole words check box when regex is on and clean the backend code

Searching for whole words does not make sense when using a regex