Trouble with converting regex to python
Question: I have this regex

    
    
    [^\\]["'&<>] 
    

in order to match some unescaped characters. However trying to convert it into
a python string is giving me grief. I've tried

    
    
    r'[^\\][\"\'&<>]' 
    

but I end up with this error.

    
    
    raise error, v # invalid expression
    sre_constants.error: bad group name
    

Any help would be appreciated!


Answer: Maybe you doing something wrong?

    
    
    import re
    
    print(bool(re.match(r'[^\\]["\'&<>]', 'a\"a')))    # True
    print(bool(re.match(r'[^\\]["\'&<>]', 'asd')))     # False
    

