# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"\/\*(?:.|\n)*?GNU General Public License(?:.|\n)*?\*\/|\"use strict\";"
test_str = ("/* \n"
" * This file is part of OverPy (https://github.com/Zezombye/overpy).\n"
" * Copyright (c) 2019 Zezombye.\n"
" * \n"
" * This program is free software: you can redistribute it and/or modify \n"
" * it under the terms of the GNU General Public License as published by \n"
" * the Free Software Foundation, version 3.\n"
" *\n"
" * This program is distributed in the hope that it will be useful, but \n"
" * WITHOUT ANY WARRANTY; without even the implied warranty of \n"
" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \n"
" * General Public License for more details.\n"
" *\n"
" * You should have received a copy of the GNU General Public License \n"
" * along with this program. If not, see <http://www.gnu.org/licenses/>.\n"
" */\n\n"
"\"use strict\";\n\n"
"astParsingFunctions[\"_&addToScore\"] = function(content) {\n\n"
" if (enableOptimization) {\n"
" if (content.args[0].name === \"__number__\" && content.args[0].args[0].numValue === 0) {\n"
" return getAstForUselessInstruction();\n"
" }\n"
" }\n"
" \n"
" return content;\n"
"}")
subst = ""
# You can manually specify the number of replacements by changing the 4th argument
result = re.sub(regex, subst, test_str, 0, re.MULTILINE)
if result:
print (result)
# 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