Grep содержимого в Python Regex [дубликат]Python

Программы на Python
Гость
Grep содержимого в Python Regex [дубликат]

Сообщение Гость »


Чтобы получить контент, я написал код ниже.

Код: Выделить всё

The paragraph continous here....................
................................................
TABLE1..
...........Text continuous...........
......... Text continuous...........
..........Text continuous...........
........Text continuous...........
........Text continuous...........
........Text continuous...........google.co.inFrancisCo.
The paragraph continous here....................
................................................
Мне нужно сопоставить шаблон «TABLEn ..... google.co.in». Я закодировал регулярное выражение ниже, но не распознал шаблон.

Код: Выделить всё

match = re.search(r'TABLE(\d+)((?:(?!google.co.in).)*)google.co.in', extractedtext, re.M)
if match:
ful = match.group()
print(f": {ful}")
# Additional processing with 'ful' if needed
else:
print("Not matched")
Someone could you please help me on this one.


Источник: https://stackoverflow.com/questions/781 ... thon-regex

Вернуться в «Python»