Регулярные выражения иногда могут быть просто монструозными. Выглядеть это может крайне запутанно. Сами регэкспы и без того история непростая, а когда это длинный паттерн на несколько десятков знаков, разобрать там что-либо становится не просто.
Но на помощь приходит Python и его стремление сделать нашу жизнь проще!
В функциях регулярок можно после паттерна указывать флаги, один из которых позволяет писать паттерны более свободно. А именно, добавлять пробелы и переносы, которые будут игнорированы. В результате мы можем разбить паттерн на строки и добавить комментов.
Чтобы это сработало нужно добавить флаг re.VERBOSE. Пробелы в паттерне теперь следует указывать явно спец символами.
Согласитесь, что даже с именованными группами а таком виде регэкспа выглядит вполне сносно 😉.
#tricks#regex
🟩Stake To Earn on #TokenPocket wallet!
TokenPocket now supports The_HaqqNetwork users to stake $ISLM on TokenPocket wallet, and the APR reaches 3.54%~5.06%!
#HAQQ is a scalable and interoperable Ethereum, built on Proof-of-Stake with fast-finality. #Islamic Coin $ISLM is a native currency of Haqq.
The staking service is powered by ColossusItaly!
#Ethiopia: Religious councils, OLA condemn killing of civilians in #East_Arsi, call for swift accountability
The Permanent Synod of the Ethiopian #Orthodox Tewahedo Church, the #Inter-Religious Council of Ethiopia, and the Ethiopian #Islamic Affairs Supreme Council have issued separate statements condemning the killing of 21 civilians in #Shirka Woreda, East Arsi Zone of #Oromia Region, urging authorities to take immediate action to bring perpetrators to justice and strengthen protection for residents.
In their respective statements, the religious institutions denounced the attack and called for swift, transparent investigations, warning against attempts to exploit the incident to incite further violence.
The Oromo Liberation Army (#OLA), for its part, accused what it described as “mercenaries” of moving through Arsi Zone and deliberately targeting Orthodox Christian civilians in an effort to inflame inter-religious and inter-ethnic tensions........
Read more: https://addisstandard.com/?p=55518