Регулярные выражения иногда могут быть просто монструозными. Выглядеть это может крайне запутанно. Сами регэкспы и без того история непростая, а когда это длинный паттерн на несколько десятков знаков, разобрать там что-либо становится не просто.
Но на помощь приходит Python и его стремление сделать нашу жизнь проще!
В функциях регулярок можно после паттерна указывать флаги, один из которых позволяет писать паттерны более свободно. А именно, добавлять пробелы и переносы, которые будут игнорированы. В результате мы можем разбить паттерн на строки и добавить комментов.
Чтобы это сработало нужно добавить флаг re.VERBOSE. Пробелы в паттерне теперь следует указывать явно спец символами.
Согласитесь, что даже с именованными группами а таком виде регэкспа выглядит вполне сносно 😉.
#tricks#regex
On traditions
The oldest traditional clothing in the Alpine region is the so called 'Bregenzerwälder Juppe'. It is worn by women of the region of Vorarlberg, a county of Austria. It goes back to the 15th century and has not changed ever since.
Unmarried girls wear a 'Schappale', an artful head garment, handmade by only a couple of artisans.
The headwear and dress often are worn lifelong on special occasions and then given to the next generation.
#tradition#custom
@EuropeanTribalism
EU and Germany Launch Tax and Customs Project to Boost Private Sector Growth in Ethiopia. (Press Release)
https://borkena.com/2026/04/24/eu-and-germany-launch-tax-and-customs-project-to-boost-private-sector-growth-in-ethiopia/#Germany#EU#Ethiopia#Tax#Custom@GerEmbAddis
@SlackRobot
Qué puede hacer este bot?
Este es un bot que se puede enseñar a responder mensajes como usted quiere.
Idioma: Inglés
(visto en @BotsGram_cu)
#automatic, #auto, #respond, #slack, #webui, #custom, #answers, #message, #question