# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"(\d{1,2}\.000) *\n* *(\d{1,4}\.\d{2})\n* *(\d{1,4}\.\d{2})\n* *(?:.*\n)?(\d{10}.*\n*[A-Z][A-Z])(*SKIP)(*F)|\D+|\d+"
test_str = ("A11111111 22222-33333 SVC,IPHONE 15 PRO,DISPLAY\n"
"1.000 368.00 368.00\n"
"8524910000 CN\n"
"G111111111/22222222222/33333\n"
"5\n"
"A11111111 22222-33333 SVC,STUDIO BUDS\n"
"+,RIGHT,TRANSPRENT, 1.000 96.00 96.00\n"
"8517620000 CN\n"
"G111111111/22222222222/33333\n"
"2\n"
"A11111111 22222-33333 SVC,STUDIO BUDS\n"
"+,LEFT,TRANSPRENT,C 1.000 96.00 96.00\n"
"8517620000 CN\n"
"G111111111/22222222222/33333\n"
"2\n"
"A11111111 22222-33333 SVC,IPHONE 14 1.000 855.00\n"
" 855.00\n"
"PRO,ROW,128G,PRP,CI/A\n"
"8517130000 CN\n"
"G111111111/22222222222/33333\n"
"7\n"
"A11111111 22222-33333 SVC,STUDIO BUDS\n"
"+,LEFT,BLACK/GOLD,C 1.000 96.00 96.00\n"
"8517620000 CN\n"
"G111111111/22222222222/33333\n"
"1")
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