Selector issue Spaces

In the selector, there is an issue where there are additional characters after the variable, so I think we need to use * at the end, and use space regex before the variable