#!/p4/common/python/bin/python3 import re pathArgList = ['...', '//foo/...@300', 'bogus', '/my/home/...#none', 'homedir', '...@3L', 'good/...', 'bad/..', '#have'] print ("\nS1: ...@") for pathArg in pathArgList: if (re.search ('\.\.\.@', pathArg)): print ("MATCH : %s" % pathArg) else: print ("NO MATCH: %s" % pathArg) print ("\nS2: ...#") for pathArg in pathArgList: if (re.search('\.\.\.#', pathArg)): print ("MATCH : %s" % pathArg) else: print ("NO MATCH: %s" % pathArg) print ("\nS3: ...$") for pathArg in pathArgList: if (re.search('\.\.\.$', pathArg)): print ("MATCH : %s" % pathArg) else: print ("NO MATCH: %s" % pathArg) print ("\nS4: Combined Search ...@|# or ...") for pathArg in pathArgList: if (re.search ('\.\.\.(@|#)', pathArg) or re.search('\.\.\.$', pathArg)): print ("MATCH : %s" % pathArg) else: print ("NO MATCH: %s" % pathArg) print ("\nS5: Finding revSpecPart") for anArg in pathArgList: revSpecPart = '' if r'@' in anArg: revSpecPart = re.sub ('^.*@', '@', anArg) if r'#' in anArg: revSpecPart = re.sub ('^.*#', '#', anArg) print ("Rev Spec Part of [%s] is [%s]." % (anArg, revSpecPart))
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15283 | C. Thomas Tyler |
Routine Merge Down to ntx64 from main using: p4 -s merge -b perforce_software-cbd-ntx64 |
||
//guest/perforce_software/cbd/main/scripts/re_fun.py | |||||
#1 | 15282 | C. Thomas Tyler | Copy Up using 'p4 copy -r -b perforce_software-cbd-dev'. | ||
//guest/perforce_software/cbd/dev/scripts/re_fun.py | |||||
#1 | 15277 | C. Thomas Tyler | Reg R&D script. |