Fix selection on RegExp input