I need to search for patterns which may have many metacharacters. Currently I use a long regex.
prodObjMatcher=re.compile(r"""^(?P<nodeName>[\w\/\:\[\]\<\>\@\$]+)""", re.S|re.M|re.I|re.X)
(my actual pattern is very long so I just pasted some relevant portion on which I need help)
This is especially painful when I need to write combinations of such patterns in a single re compilation.
Is there a pythonic way for shortening the pattern length?