Search and Select uses regex only if match case is off.
Opened this issue · 0 comments
Okxa commented
search_and_select function has an issue where the regex is only used if match case is checked, regardless of "Use Regex" checkbox.
Something like this should work:
if wm.renaming_useRegex == False:
if wm.renaming_matchcase == True:
if entityName.find(searchReplaced) >= 0:
selectionList.append(entity)
msg.addMessage("selected", entityName)
else:
if re.search(searchReplaced, entityName, re.IGNORECASE):
selectionList.append(entity)
else:
if re.search(searchReplaced, entityName):
selectionList.append(entity)
It should be the correct logic, assuming the previous implementation was correct for renaming when ignoring case. (And if when searching with regex the match case option should be ignored. Atleast the Match Case checkbox is greyed out when Use Regex is checked)