import re
regex = re.compile(r"^(?!plugins/(arve-|advanced-re|edd-)).+", flags=re.MULTILINE)
test_str = ("plugins/advanced-responsive-video-embedder\n"
"plugins/arve-amp\n"
"plugins/arve-pro\n"
"plugins/arve-random-video\n"
"plugins/arve-sticky-videos\n"
"plugins/boilerplate\n"
"plugins/classic-editor\n"
"plugins/composer-local\n"
"plugins/debug-bar\n"
"plugins/debug-bar-actions-and-filters-addon\n"
"plugins/debug-bar-constants\n"
"plugins/debug-bar-shortcodes\n"
"plugins/debug-bar-slow-actions\n"
"plugins/disabler\n"
"plugins/edd-better-checkout\n"
"plugins/edd-bootstrap-styles\n"
"plugins/example2\n"
"plugins/gutenberg\n"
"plugins/gutenberg-boilerplate\n"
"plugins/jd-shortcode\n"
"plugins/n-arve-divi-workaround\n"
"plugins/n-arve-divi-workaround.zip\n"
"plugins/n-arve-invidious\n"
"plugins/n-arve-rest-api\n"
"plugins/n-arve-videojs")
matches = regex.finditer(test_str)
for match_num, match in enumerate(matches, start=1):
print(f"Match {match_num} was found at {match.start()}-{match.end()}: {match.group()}")
for group_num, group in enumerate(match.groups(), start=1):
print(f"Group {group_num} found at {match.start(group_num)}-{match.end(group_num)}: {group}")
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