# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"""
#
# DocBlock to PHPDoc
#
# @author Richard Fussenegger <richard@fussenegger.info>
#
# Original phpDocumentor RegExp
#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?
#
(?:^\s*\/\*\*\s+(?:\*[ \t]?)?|\s+\*\/\s*|[ \t]+\*[ \t]?)
"""
test_str = ("/**\n"
" * This is a summary.\n"
" * This is a {@internal beautiful}} description.\n"
" *\n"
" * @see \\SimpleXmlElement the XML reader with which this object is constructed\n"
" * @var \\SimpleXmlElement {\n"
" * The configuration root node that contains all settings for this component.\n"
" * @property string \\$name\n"
" * @property integer \\$version\n"
" * }\n"
" */")
subst = ""
# You can manually specify the number of replacements by changing the 4th argument
result = re.sub(regex, subst, test_str, 0, re.VERBOSE)
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