import re
regex = re.compile(r"^[1-9][0-9]{4,}$", flags=re.MULTILINE)
test_str = ("12345\n"
"1234\n"
"12345678900000\n"
"1234.10\n"
"12345.10\n"
"100\n"
"101.50\n"
"2000\n"
"3000.30\n"
"0...000...\n"
"000000.0000000\n"
"0004\n"
"2222\n"
"9999\n"
"10000 \n"
"200001\n"
"100000\n"
"1000.00\n"
"100001\n"
"3000.30\n"
"100.00 \n")
matches = regex.finditer(test_str)
for match_num, match in enumerate(matches, start=1):
print(f"Match {match_num} was found at {match.start()}-{match.end()}: {match.group()}")
for group_num, group in enumerate(match.groups(), start=1):
print(f"Group {group_num} found at {match.start(group_num)}-{match.end(group_num)}: {group}")
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