У меня есть эти данные:
{{Character
| Title=Jhiqui
| Image=Jhiqui.png
}}
{{Ala|a;a}}
Я хочу написать регулярное выражение на python, которое соответствует содержанию внутри {{}}
для первых данных, но ничего для вторых.
У меня есть это \{\{(.+?)\}\}
, что с DOTALL соответствует содержанию обеих строк. Я хочу добавить что-то к регулярному выражению, которое требует, чтобы содержимое внутри {{}}
содержало один или несколько =
.
Как я могу это сделать?
Регулярное выражение, данное @heemayl, не соответствует следующему тексту:
{{Character\n| Title = Jon Snow\n| Image = Profile-JonSnow-707.png\n| Season = [[Season 1|1]], [[Season 2|2]], [[Season 3|3]], [[Season 4|4]], [[Season 5|5]], [[Season 6|6]], [[Season 7|7]], [[Season 8|8]]\n| First = "[[Winter is Coming (episode)|Winter is Coming]]"\n| Last = \n| Appearances =\n| Aka = Aegon Targaryen<br>Lord Snow<br>The Bastard of Winterfell<br>King Crow<br>[[The Prince That Was Promised]]<br>The White Wolf\n| Status = [[:Category: Living individuals|Alive]] <small>(resurrected)</small>\n| Titles = [[Warden|Warden of the North]] <br>[[King in the North]] <small>(formerly)</small><BR>\n998th [[Lord Commander of the Night\'s Watch]] <small>(formerly)</small>\n| Place = [[Tower of Joy]] <small>(birthplace)</small><br>[[Winterfell]] <small>(raised)</small>\n| Allegiance = [[House Stark]]<br>[[House Targaryen]] <small>(by pledge)</small><br>The [[Night\'s Watch]] <small>(formerly)</small>\n| Family = \n| Lovers = [[Daenerys Targaryen]]<br>{[[Ygritte]]}\n| Religion = [[Old Gods of the Forest]]\n| Culture = [[Northmen]]<!--Please do not add "Valyrian" to his culture. Despite his blood, he was raised a Northman, without any knowledge of his heritage. This has been discussed and clarified, so insisting on it will be considered fanon and dealt with accordingly-->\n| Actor = [[Kit Harington]]\n| Age = 23 in Season 8<ref>Jon is roughly the same age as Robb Stark, and they were both born near the end of Robert\'s Rebellion - which in the novels was 15 years before the beginning of the narrative, so they were both about 14. In the TV version, the rebellion was 17 years ago, making Jon and Robb 16 in Season 1. Seven years pass in the TV series by Season 8.</ref>\n|Birth = Shortly after [[Robert\'s Rebellion]], [[Timeline#Robert\'s Rebellion|281 AC]]\n|Death = [[Timeline#Season 5 - 302 AC|302 AC]]<br>\nStabbed to death by his own men in the [[Mutiny at Castle Black]] <small>(later resurrected)</small>\n|DeathEp = [[Mother\'s Mercy]] <small>(soon after resurrected)</small>\n|Father = Biological:<br>\n{[[Rhaegar Targaryen]]}\n----\nAdoptive:<br>\n{[[Eddard Stark]]}\n|Mother = {[[Lyanna Stark]]}\n|Siblings = Paternal half-siblings:<br>\n{[[Rhaenys Targaryen (daughter of Rhaegar)|Rhaenys Targaryen]]}<br>\n{[[Aegon Targaryen (son of Rhaegar)|Aegon Targaryen]]} (son of Elia)\n----\nMaternal cousins raised as half-siblings:<br>\n{[[Robb Stark]]}<br>\n[[Sansa Stark]]<br>\n[[Arya Stark]]<br>\n[[Bran Stark]]<br>\n{[[Rickon Stark]]}<br>\n}}
Что должно быть сопоставлено и получаетсовпал с моим простым регулярным выражением, которое не проверяет =
.
Есть идеи почему?