import re
regex = re.compile(r".getval{(.*?)}", flags=re.DOTALL)
test_str = (".img-circle m-b{height:120px; width:105px;} \n"
"#upload{display:none}\n"
".getval{\n"
"visibility: none;\n"
"width:60px;\n"
"height:60px;\n"
"} \n"
"#mce_0{position: relative;} \n"
"#mce_1{\n"
"position: relative;\n"
"visibility: none;\n"
"width:60px;\n"
"height:60px;\n"
"} \n"
"#mce_2{position: relative;} \n"
"#mce_3{position: relative;} \n"
"#mce_4{position: relative;} \n"
"null{color: #808000;} \n"
"#mce_5{position: relative;}")
subst = "vibility:visible;"
result = regex.sub(subst, test_str, count=1)
if result:
print(result)
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