fix regular expression escape and ui bug