Регулярные выражения иногда могут быть просто монструозными. Выглядеть это может крайне запутанно. Сами регэкспы и без того история непростая, а когда это длинный паттерн на несколько десятков знаков, разобрать там что-либо становится не просто.
Но на помощь приходит Python и его стремление сделать нашу жизнь проще!
В функциях регулярок можно после паттерна указывать флаги, один из которых позволяет писать паттерны более свободно. А именно, добавлять пробелы и переносы, которые будут игнорированы. В результате мы можем разбить паттерн на строки и добавить комментов.
Чтобы это сработало нужно добавить флаг re.VERBOSE. Пробелы в паттерне теперь следует указывать явно спец символами.
Согласитесь, что даже с именованными группами а таком виде регэкспа выглядит вполне сносно 😉.
#tricks#regex
#The_Economist🇬🇧📕[PDF]⬇️
15 #November2025
#Weekly_Magazines
For learning, for free(dom).
@backupofmagazines
This week’s Economist tracks how an emerging #AIBubble, volatile #Markets, and shifting #Geopolitics could reshape 2026. From Taiwan’s hidden economic risks to Mexico’s security crisis and Europe’s democratic strain, global fault lines widen. China faces birth-rate pressures and reputational challenges, while the U.S. wrestles with #Trumpforce, homeschooling, and e-bike parenting. Business pages explore #Chatbots, HR’s rise, and America’s “seven deadly sins.” Finance dives into “recession-recession” fears and personal-finance defence. Science highlights #AI superforecasting and whales’ vowel systems. A dense but essential issue for anyone tracking #Tech, #Policy, and global stability.
#The_Bloomberg🇺🇸📕[PDF]⬇️
#November2025
#Monthly_Magazines
For learning, for free(dom).
@backupofmagazines
This issue pits #GavinNewsom against a shifting #USPolitics map while probing the supposed #AIBubble, from frothy valuations to real-world productivity. A climate-forensics read asks whether #CloudSeeding worsened Dubai’s deadly storm—at the nexus of #ExtremeWeather and #ClimateChange. The geo-economics file tracks India’s wobbling investments, China’s expanding #Ports, and weaponized #SupplyChains. For investors, the issue weighs #ETFs, #401k tweaks, #BigTech concentration risk, and hedges in #Europe and #Gold. Lifestyle detours sample Utah powder and the dive-bar revival. It’s a brisk tour of power, money, and culture in a volatile world. #Markets#Investing#Energy#MiddleEast#Africa#Healthcare#Birkenstocks