Fix some bugs in notepadCtrl. Change search method from preg to string