# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"^.*\d*\.\d+\t\d*\.\d+.*$"
test_str = ("some information: bla bla\n"
"test time: 1.34\n"
"something else 23.00\n"
"data1 data2\n"
"0.01 0.22\n"
"0.2 0.34\n"
"0.2 0.34\n"
"adf asdf 0.2 asdfasf 1.2 2.3 sdfs\n"
".....\n\n"
"The text information before data1 can vary in number of rows and data1 and data2 can also vary.\n"
"I wold prefer a solution with pandas, but everything else is acceptable.")
matches = re.finditer(regex, test_str, re.MULTILINE)
for match in matches:
print(match.group(0))
IyBjb2Rpbmc9dXRmOAojIHRoZSBhYm92ZSB0YWcgZGVmaW5lcyBlbmNvZGluZyBmb3IgdGhpcyBkb2N1bWVudCBhbmQgaXMgZm9yIFB5dGhvbiAyLnggY29tcGF0aWJpbGl0eQoKaW1wb3J0IHJlCgpyZWdleCA9IHIiXi4qXGQqXC5cZCtcdFxkKlwuXGQrLiokIgoKdGVzdF9zdHIgPSAoInNvbWUgaW5mb3JtYXRpb246IGJsYSBibGFcbiIKCSJ0ZXN0IHRpbWU6IDEuMzRcbiIKCSJzb21ldGhpbmcgZWxzZSAyMy4wMFxuIgoJImRhdGExIGRhdGEyXG4iCgkiMC4wMQkwLjIyXG4iCgkiMC4yCTAuMzRcbiIKCSIwLjIgMC4zNFxuIgoJImFkZiBhc2RmIDAuMiBhc2RmYXNmIDEuMgkyLjMgc2Rmc1xuIgoJIi4uLi4uXG5cbiIKCSJUaGUgdGV4dCBpbmZvcm1hdGlvbiBiZWZvcmUgZGF0YTEgY2FuIHZhcnkgaW4gbnVtYmVyIG9mIHJvd3MgYW5kIGRhdGExIGFuZCBkYXRhMiBjYW4gYWxzbyB2YXJ5LlxuIgoJIkkgd29sZCBwcmVmZXIgYSBzb2x1dGlvbiB3aXRoIHBhbmRhcywgYnV0IGV2ZXJ5dGhpbmcgZWxzZSBpcyBhY2NlcHRhYmxlLiIpCgptYXRjaGVzID0gcmUuZmluZGl0ZXIocmVnZXgsIHRlc3Rfc3RyLCByZS5NVUxUSUxJTkUpCgpmb3IgbWF0Y2ggaW4gbWF0Y2hlczoKCXByaW50KG1hdGNoLmdyb3VwKDApKQo=