#!/usr/bin/python
import re
regexPattern = re.compile('^(?!\\/usr\\b|\\/var)(\\/[\\w]+)+\\/?$')
inputString = [ "/", "/usr", "/var", "/test" ]
for v in inputString:
m = re.match(regexPattern, v)
print("")
print("Test String " + v )
if m:
print("Full Match" + m.group())
print("Pass")
else:
print("No Match")
No comments:
Post a Comment