I am actually working on Python regex that excludes certain file path. I am creating this regex in a property file , and then passing to my python code
import re
regex = ".*-old-.*"
sequence = "/tmp/file-old-1"
print re.match(regex, sequence)
Now , I want to build a regex that do not match for anything. Is it possible to have so. Any help will be helpful !
Thanks !
regexis used to match strings containing a pattern you define. When you say do not match anything, do you mean perform an action if your current regex has no match? Whats your input and expected output?python-3.x, and it has a syntax error for Python 3, and guaranteed broken code in any version of Python (//is not a comment character in Python, so you're trying to divide the result ofre.matchbyTrue). If you're going to provide code samples, at least make them legal code.