What if you find a string in a file, match the first line that begins with another string on the line on which it is located, and output it?

is what I want to do if I find a string from a file, match the first line starting with another string on its line direction and output it. Python.

Jan.17,2022

import re
with open("./text.txt") as f:
    lines = f.readlines()
    for index, line in enumerate(lines):
        if re.search("c",line):
            for content in lines[:index][::-1]:
                if re.search("\d",content):
                    print(content)
                    break

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ec906d-2f17.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ec906d-2f17.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?