Регулярные выражения иногда могут быть просто монструозными. Выглядеть это может крайне запутанно. Сами регэкспы и без того история непростая, а когда это длинный паттерн на несколько десятков знаков, разобрать там что-либо становится не просто.
Но на помощь приходит Python и его стремление сделать нашу жизнь проще!
В функциях регулярок можно после паттерна указывать флаги, один из которых позволяет писать паттерны более свободно. А именно, добавлять пробелы и переносы, которые будут игнорированы. В результате мы можем разбить паттерн на строки и добавить комментов.
Чтобы это сработало нужно добавить флаг re.VERBOSE. Пробелы в паттерне теперь следует указывать явно спец символами.
Согласитесь, что даже с именованными группами а таком виде регэкспа выглядит вполне сносно 😉.
#tricks#regex
🤝#Electra is not just a DEX but your advantage in the market!
Electra will soon open access to a unique trading platform with the best tools for smarter, faster and more efficient trading.
⚡️The main advantages of the future platform:
✔️Artificial intelligence for predicting market trends and automating portfolios.
✔️Freedom and security: none🙅 KYC, up to 1000x leverage and multi-chain trading.
✔️Social features: real-time communication, participation in the Electra Trading League and obtaining unique Proof-of-Trade NFTs.
✔️Access to deep liquidity with CEX-level efficiency in a decentralized environment.
✔️CEX-like performance: Using the #Lumia L2 infrastructure, #Electra delivers lightning-fast trades with tight spreads.
✔️No profit limits: no open interest limits, no funding rate limits, and no arbitrary rules.
✔️Trade 24/7 on web platform, desktop or via Telegram Mini App with professional tools and analytics.
✔️Game-based learning with Bulls'n'Bears — a fun educational game in Telegram Mini App.
🤑 While we wait for the release of the DEX platform, we continue to participate in current activities:
✔️Farm points in Electra MiniApp
✔️Play Bulls'n'Bears
✔️Complete daily tasks
🚀Dive into the world of Electra
#Electra#TON#DEX#NoKYC#Web3