Регулярные выражения иногда могут быть просто монструозными. Выглядеть это может крайне запутанно. Сами регэкспы и без того история непростая, а когда это длинный паттерн на несколько десятков знаков, разобрать там что-либо становится не просто.
Но на помощь приходит Python и его стремление сделать нашу жизнь проще!
В функциях регулярок можно после паттерна указывать флаги, один из которых позволяет писать паттерны более свободно. А именно, добавлять пробелы и переносы, которые будут игнорированы. В результате мы можем разбить паттерн на строки и добавить комментов.
Чтобы это сработало нужно добавить флаг re.VERBOSE. Пробелы в паттерне теперь следует указывать явно спец символами.
Согласитесь, что даже с именованными группами а таком виде регэкспа выглядит вполне сносно 😉.
#tricks#regex
#South Africa
The penguin colony of more than 3,000 individuals lives on the beach of Bolders. The penguins adapted to the climate perfectly and does not experience any problems and worries at all.
#South Korea
🇰🇷🤝🇺🇿
🇺🇿 Janubiy Koreyaning Lotte foundation mukofoti “Koreys filologiyasi” yoʻnalishi talabalariga topshirildi.
—
🇷🇺 Премия южнокорейского фонда Lotte foundation вручена студентам факультета «Корейская филология»
—
🇬🇧 The scholarship of Lotte Foundation (South Korea) was presented to students of the Faculty of Korean Philology.
👩💼Read more: www.kiut.uz
20 casualties among Israeli soldiers after Hezbollah thwarted their infiltration attempt in Adaisseh, on the Lebanese border.
#Israel#Lebanon#Hezbollah#South
South Africa may choose Russia and Iran for its nuclear project
South Africa is considering cooperation with Russia and Iran to expand its civilian nuclear capacity, a move that could complicate relations with the United States and delay the renewal of a strategic energy deal between the countries, Reuters reports.
South Africa, home to the continent's only nuclear power plant, the Koeberg, is planning to add 2,500 megawatts of new capacity to combat power outages and reduce emissions. The country has announced a tender and, according to Minerals and Petroleum Resources Minister Gwede Mantashe, Russia and Iran will not be excluded from it.
"If their proposals are the best, we will choose them," he stressed.
The statement has caused concern in Washington. Earlier, US President Donald Trump signed an executive order limiting aid to South Africa, citing its alleged military and nuclear cooperation with Iran. South African authorities have denied the allegations.
A South African nuclear tender planned for last year has been delayed by legal wrangling. Meanwhile, work is underway on a new US-South African nuclear cooperation agreement (the 123 Agreement), which is needed to export nuclear technology and fuel from the US.
The previous agreement expired in 2022. According to Zizamele Mbambo, an official in the South African Department of Energy, the negotiations have been completed at a technical level, but the signing is being delayed by legal procedures.
Analysts say South Africa's decision to turn to Russia and Iran could heighten geopolitical tensions and slow the restoration of cooperation with the US.
#AREA#South Africa #Russia#Iran#USA
News: #Tigray institutions renew calls for dialogue, reconciliation amid continued internal clashes
Religious and civic institutions in Tigray have renewed calls for dialogue and an end to internal fighting, urging combatants to halt hostilities and pursue reconciliation as clashes continue in parts of the region, despite recent signs of de-escalation in the #south.
The Synod of the #Selama Tigray Orthodox Tewahedo Church, following an emergency meeting, said that “the mutual destruction occurring between brothers must stop,” and announced plans to actively engage in efforts to end the killings.
In a statement shared with journalists, the Synod said that as people in Tigray face one of the gravest crises in recent history, it is seeking to foster understanding and reconciliation to bring an end to internal violence.
Similarly, Tigray #Public_Diplomacy issued an emergency statement titled “Stop the War: Let Us Return to Dialogue,” recalling an earlier...
Read more: https://addisstandard.com/?p=55017