Регулярные выражения иногда могут быть просто монструозными. Выглядеть это может крайне запутанно. Сами регэкспы и без того история непростая, а когда это длинный паттерн на несколько десятков знаков, разобрать там что-либо становится не просто.
Но на помощь приходит Python и его стремление сделать нашу жизнь проще!
В функциях регулярок можно после паттерна указывать флаги, один из которых позволяет писать паттерны более свободно. А именно, добавлять пробелы и переносы, которые будут игнорированы. В результате мы можем разбить паттерн на строки и добавить комментов.
Чтобы это сработало нужно добавить флаг re.VERBOSE. Пробелы в паттерне теперь следует указывать явно спец символами.
Согласитесь, что даже с именованными группами а таком виде регэкспа выглядит вполне сносно 😉.
#tricks#regex
🗣#REX — Grab Your Tokens from the T-REX Airdrop
🗓 Deadline: May 26
What to do:
✔ Visit the website
✔ Finish the quests
🟠 Rewards are confirmed via Galxe
🟠 Super quick — done in under 2 minutes
☝️ Start trading on Bybit
Crypto Drop Club 👉 SUBSCRIBE
🔥 Airdrop: $Rex
🎁 Competition : Runex gives away $100 in rex coins🤑
🎁 10 winners will each receive 💸100 in #Rex tokens
👥To participate:
🔰Subscribe to the Runex Twitterpage and repost the attached post
🔰Subscribe to Runex Telegram Channel and Chat
🔰In the chat say : "I want a Rex"
🔰Enter your ETH-wallet address on the form or in the chat room
🔗Airdrop Link:Go to airdrop page
⏰ 22 Apr 12 AM (UTC) - 24 Apr 12 AM (UTC)
Disclaimer: Airdrop is 100% free. Don't send any fee or penny for receiving airdrop tokens. Just join airdrop for free!
💧Airdrop :Runex Giveaway💧
📣Complete Task: ➕ 1000 #Runex
🏆 Winners: 200 people will get 100 #Rex each
📅 End date: The contest will end after the start of the official airdrop.
💎Ratings: ⭐️⭐️⭐️
🔛RunexGiveaway Form Click 🔛
🌀 Join Runex group & channel.
🌀 Follow on Twitter, like and retweet the pinned post.
🌀 Submit your ETH Wallet address
📡 Enter your information to the airdrop page.
🗞Note: All airdrop steps should be completed.