# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"http:\/\/seluws1215\/PM2\/flex\/ProcessManager(?:Flex)?\.(?:php|html)\?#?(?:v=\d*&)?\w*=(\d*)"
test_str = ("http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=12932\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php \n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=13179\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=15032\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=15121\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=16452\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=13018\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=15568\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=15568\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=7056 \n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=16283\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=16283\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=16929\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=15587\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=16394\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=18585\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=17532\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=18292\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=18461\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=18848\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=18461\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=18461\n"
"http://seluws1215/pm2/flex/ProcessManagerFlex.php?start=20177\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20551 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20423 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=18613 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20870 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=17747 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=12930 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=21032 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20551 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=17531 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=21283 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=16929 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20804 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24585 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=23807 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=21795 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24569 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24879 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24884 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24884 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20898 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24884 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24884 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=25769 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24410 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24734 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=25812 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=21143 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24395 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=25890 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=25890 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=25890 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=25890 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=25890 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=14869 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20777 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=25819 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=25819 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=21735 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=26842 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=26842 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=27084 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=23271 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=27067 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=25954 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=18409 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=21659 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=18585 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=21208 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=28335 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24395 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24863 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=27054 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=26842 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=26842 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=18585 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=28340 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=28948 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=29035 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=28927 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=26352 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=26361 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=29021 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=29189 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=29189 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=29719 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=29626 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=296229 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=29743 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=27244 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=29953 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=21771 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=28340 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=21710 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=27138 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=27624 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=28238 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=23275 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24410 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=30508 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=30508 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=18848 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=30234 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=30223 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=30239 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=30242 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=30260 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24213 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24214 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=27027 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=7056 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=27069 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24410 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24410 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=30622 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=28658 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=25954 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=18543 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=12829 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24762 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=26657 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=29163 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=31123 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20551 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=31149 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=31162 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=29882 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=7057 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=17329 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=29961 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=17049 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=17329 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=31243 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=31243 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=30292 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=27624 \n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20895\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20895\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=16385\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=14984\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=31841\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=21735\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=31840\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=31847\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=31864\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=14384\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=23271\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=24534\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=27145\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=32265\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20728\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=6858\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=28942\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=26466\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=28942\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=28942\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=30292\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=23298\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=32307\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=12930\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=30543\n"
"http://seluws1215/pm2/flex/ProcessManager.php?#page=16384\n"
"http://seluws1215/pm2/flex/ProcessManager.php?#page=17104\n"
"http://seluws1215/pm2/flex/ProcessManager.php?#page=16384\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=32306\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=28948\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=16384\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=32166\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=26266\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=17016\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=7093\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=29866\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20551\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20728\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=20856\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=26228\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=32265\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=27145\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=13237\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=32711\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=32306\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=31342\n"
"http://seluws1215/pm2/flex/ProcessManager.php?start=33648")
matches = re.finditer(regex, test_str, re.MULTILINE | re.IGNORECASE)
for matchNum, match in enumerate(matches, start=1):
print ("Match {matchNum} was found at {start}-{end}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group()))
for groupNum in range(0, len(match.groups())):
groupNum = groupNum + 1
print ("Group {groupNum} found at {start}-{end}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum)))
# Note: for Python 2.7 compatibility, use ur"" to prefix the regex and u"" to prefix the test string and substitution.
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html