I was thinking about something like: import re
regex = re.compile(r"(.*[lL]_\w*_[cntlCNTL]{4})") all_elements = cmds.ls() for element in all_elements: print regex.match(element) Tell me if that works for you! Cheers! El jueves, 21 de febrero de 2019, 21:17:23 (UTC+1), Francesco escribió: > > Hi everybody! > > I have a question on whether it's possible to ignore the case sensitivity > when checking if something exists. Here's an example: > > if cmds.objExists("L_*_CNTL") == False: > cmds.error("Error! No left side CNTLs were found!") > > Basically I want to check if there are controllers that have the "L" > prefix and "CNTL" suffix, but sometimes there might be scenarios where the > rigger used different naming conventions, using lower case "l", lower case > "cntl" or a mix, like "Cntl". > > > Thanks! > > -Francesco > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/10649426-e94c-44c2-855b-88e73ad03f13%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.