Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в Python в модуле re.
Чтобы указать флаг для компилятора нам надо указать его после передаваемой строки. Например, добавляем флаг для игнорирования переноса строки.
pattern = re.compile(r"(\w+)+")
words = pattern.search(text, re.DOTALL)
А как указать несколько флагов? Ведь явно будут ситуации когда нам потребуется больше одного. Кто читал посты по битовые операторы уже понял как.
pattern.search(text, re.DOTALL | re.VERBOSE)
А теперь смотрим исходники, что находится в этих атрибутах?
Не удивительно, степени двойки. Почему? Потому что каждое следующее значение это сдвиг единицы влево.
>>> for n in [1, 2, 4, 8, 16, 32, 64, 128, 256]:
>>>
print(bin(n))
0b1
0b10
0b100
0b1000
0b10000
0b100000
0b1000000
0b10000000
0b100000000
Чтобы было понятней, давайте напишем тоже самое но иначе, добавим ведущие нули:
000000001
000000010
000000100
000001000
000010000
000100000
001000000
010000000
100000000
Не понятно что тут происходит? Читай три поста про битовые операторы начиная с этого ➡️https://t.me/pythonotes/45
В общем, это пример применения побитовых операций в самом Python.
Теперь вы знаете Python еще немного лучше)
#tricks#regex#libs
🚀 What an incredible start to Token2049!
The energy at the #CoinEx booth has been electric, with non-stop engagement from our global community.
A massive thank you to everyone who joined the queues for our exclusive merch, participated in vibrant discussions, and shared their insights on the future of crypto.
The excitement is just getting started. If you missed the Day 1 action, there's still time to connect.
Find us at our booth tomorrow!
⚡️ Transform your crypto experience with CoinEx, just like Wukong's 72 transformations. Get started today!
➡️ Register CoinEx: https://www.coinex.com/register?refer_code=webgh
#Wukong#CoinEx
⚡️ Defy the odds like Wukong in battle. On CoinEx, every trade is a step toward your next big victory!
➡️ Register CoinEx: https://www.coinex.com/register?refer_code=webgh
#Wukong#CoinEx
✔️ Master the art of trading, just like Wukong mastered his powers. Start with CoinEx today and become a crypto legend
➡️ Register CoinEx: https://www.coinex.com/register?refer_code=webgh
#Wukong#CoinEx
✔️ Forge your own crypto legend with CoinEx, just like Wukong in his journey. Start trading today!
➡️ Register CoinEx: https://www.coinex.com/register?refer_code=webgh
#Wukong#CoinEx
💥 Every trade is a step closer to victory! CoinEx is your battlefield—are you ready to conquer?
➡️ Register CoinEx: https://www.coinex.com/register?refer_code=webgh
#Wukong#CoinEx
👍Like Wukong battling epic bosses, conquer your crypto journey with CoinEx. Sign up now and get ready to take on the world of digital assets!
➡️ Register CoinEx: https://www.coinex.com/register?refer_code=webgh
#Wukong#CoinEx
🔥 CoinEx continues to deliver on its promise! 🔥
💵$CET's 1st Monthly Repurchase & Burn 🔥 of 2026 is complete:
🔥🔥🔥🔥🔥🔥🔥🔥
🪙 Repurchased & Burned $CET: 13.4 M $CET
💰 Remaining $CET: 2.53 B $CET (25.3%~)
🔥🔥🔥🔥🔥🔥🔥🔥
In line with our commitment, we continue daily #CET repurchases & monthly token burns to maintain the #CoinEx deflationary mechanism.🌐
🖐 Find the details HERE
🎯 Why Hold $CET?
$CET isn’t just a token — it’s your key to the CoinEx ecosystem!
✅ Trading fee discounts
✅ VIP privileges & exclusive promos
✅ Daily interest rate discount in Margin borrow
✅ Daily buybacks & monthly burns
✅ Referral ratio upgraded, with up to 40% rewards
✅ Exclusive promotional privileges:
✅ CET Staking
✅ CoinEx Mining
As CoinEx grows, so does CET’s utility and value.
Find CoinEx:
🌐Web
❌𝕏
✉️Telegram
✈Announcement
🛜Discord
🔥 CoinEx continues to deliver on its promise! 🔥
💵$CET's 11th Monthly Repurchase & Burn 🔥 of 2025 is complete:
🔥🔥🔥🔥🔥🔥🔥🔥
🪙 Repurchased & Burned $CET: 16.9 M $CET
💰 Remaining $CET: 2.56 B $CET (25.6%~)
🔥🔥🔥🔥🔥🔥🔥🔥
In line with our commitment, we continue daily #CET repurchases & monthly token burns to maintain the #CoinEx deflationary mechanism.🌐
🖐 Find the details HERE
🎯 Why Hold $CET?
$CET isn’t just a token — it’s your key to the CoinEx ecosystem!
✅ Trading fee discounts
✅ VIP privileges & exclusive promos
✅ Daily interest rate discount in Margin borrow
✅ Daily buybacks & monthly burns
✅ Referral ratio upgraded, with up to 40% rewards
✅ Exclusive promotional privileges:
✅ CET Staking
✅ CoinEx Mining
As CoinEx grows, so does CET’s utility and value.
Find CoinEx:
🌐Web
❌𝕏
✉️Telegram
✈Announcement
🛜Discord
🔥 CoinEx continues to deliver on its promise! 🔥
💵$CET's 10th Monthly Repurchase & Burn 🔥 of 2025 is complete:
🔥🔥🔥🔥🔥🔥🔥🔥
🪙 Repurchased & Burned $CET: 16.9 M $CET
💰 Remaining $CET: 2.57 B $CET (25.7%~)
🔥🔥🔥🔥🔥🔥🔥🔥
In line with our commitment, we continue daily #CET repurchases & monthly token burns to maintain the #CoinEx deflationary mechanism.🌐
🖐 Find the details HERE
🎯 Why Hold $CET?
$CET isn’t just a token — it’s your key to the CoinEx ecosystem!
✅ Trading fee discounts
✅ VIP privileges & exclusive promos
✅ Daily interest rate discount in Margin borrow
✅ Daily buybacks & monthly burns
✅ Referral ratio upgraded, with up to 40% rewards
✅ Exclusive promotional privileges:
✅ CET Staking
✅ CoinEx Mining
As CoinEx grows, so does CET’s utility and value.
Find CoinEx:
🌐Web
❌𝕏
✉️Telegram
✈Announcement
🛜Discord
🔥 CoinEx continues to deliver on its promise! 🔥
💵$CET's 8th Monthly Repurchase & Burn 🔥 of 2025 is complete:
🔥🔥🔥🔥🔥🔥🔥🔥
🪙 Repurchased & Burned $CET: 22.2 M $CET
💰 Remaining $CET: 2.61 B $CET (26.1%~)
🔥🔥🔥🔥🔥🔥🔥🔥
In line with our commitment, we continue daily #CET repurchases & monthly token burns to maintain the #CoinEx deflationary mechanism.🌐
🖐 Find the details HERE
🎯 Why Hold $CET?
$CET isn’t just a token — it’s your key to the CoinEx ecosystem!
✅ Trading fee discounts
✅ VIP privileges & exclusive promos
✅ Daily interest rate discount in Margin borrow
✅ Daily buybacks & monthly burns
✅ Referral ratio upgraded, with up to 40% rewards
✅ Exclusive promotional privileges:
✅ CET Staking
✅ CoinEx Mining
As CoinEx grows, so does CET’s utility and value.
Find CoinEx:
🌐Web
❌𝕏
✉️Telegram
✈Announcement
🛜Discord
🔥 CoinEx continues to deliver on its promise! 🔥
💵$CET's 7th Monthly Repurchase & Burn 🔥 of 2025 is complete:
🔥🔥🔥🔥🔥🔥🔥🔥
🪙 Repurchased & Burned $CET: 17.45 M $CET
💰 Remaining $CET: 2.632 B $CET (26.3%~)
🔥🔥🔥🔥🔥🔥🔥🔥
In line with our commitment, we continue daily #CET repurchases & monthly token burns to maintain the #CoinEx deflationary mechanism.🌐
🖐 Find the details HERE
🎯 Why Hold $CET?
$CET isn’t just a token — it’s your key to the CoinEx ecosystem!
✅ Trading fee discounts
✅ VIP privileges & exclusive promos
✅ Daily interest rate discount in Margin borrow
✅ Daily buybacks & monthly burns
✅ Referral ratio upgraded, with up to 40% rewards
✅ Exclusive promotional privileges:
✅ CET Staking
✅ CoinEx Mining
As CoinEx grows, so does CET’s utility and value.
Find CoinEx:
🌐Web
❌𝕏
✉️Telegram
✈Announcement
🛜Discord