Как связать несколько столбцов с одной таблицей через внешний ключ?

Я хотел бы сделать это (пояснение в комментариях):

import re

# If you need to use the regex more than once it is suggested to compile it.
pattern = re.compile(r"")

# <\/{0,}\[\d+>
# 
# Match the character “<” literally «<»
# Match the character “/” literally «\/{0,}»
#    Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «{0,}»
# Match the character “[” literally «\[»
# Match a single digit 0..9 «\d+»
#    Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
# Match the character “>” literally «>»

subject = """this is a paragraph with<[1> in between and then there are cases ... where the<[99> number ranges from 1-100. 
and there are many other lines in the txt files
with<[3> such tags """

result = pattern.sub("", subject)

print(result)

Если вы хотите узнать больше о регулярном выражении, я рекомендую прочитать Cookbook по регулярным выражениям Ян Гойваертс и Стивен Левитан.

0
задан Sterling Archer 27 March 2019 в 15:10
поделиться