Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
🎁 Share $150,000 in ZETA!
Join UltiverseDAO with TokenPocket_TP, one of the events on #TokenPocketChristmas!
👉https://galxe.com/TokenPocket/campaign/GChG6ttcDb
✅Finish the on-chain task with ZERO cost on zetablockchain Testnet, follow the guide, and claim your Testnet token.
👉https://tp-lab.tptool.pro/tokenpocket-christmas/?locale=en#/
✅Ultiverse Tutorial UltiverseDAO
👉https://ultiversedao.medium.com/tokenpocket-christmas-with-ultiverse-and-zetachain-meta-merge-match-three-tutorials-79a67fe45843
【Details】https://twitter.com/TokenPocket_TP/status/1743563318995099984
【Powered By】Crypto Box
🎁 Share $150,000 in ZETA!
Join zkme_ Journey with TokenPocket_TP, one of the events on #TokenPocketChristmas!
👉https://galxe.com/TokenPocket/campaign/GCnW8tthSy
✅Finish the on-chain task with ZERO cost on zetablockchain
Testnet, follow the guide, and claim your Testnet token.
👉https://tp-lab.tptool.pro/tokenpocket-christmas/?locale=en#/
✅zkme_ Tutorial
👉https://medium.com/@zkMe/spread-holiday-cheer-with-zkme-identity-oracles-your-christmas-lucky-sign-06c69eaa3fd3
🎁 Share $150,000 in ZETA!
Join zetaswapdex Journey with TokenPocket_TP, one of the events on #TokenPocketChristmas!
👉https://galxe.com/TokenPocket/campaign/GCTy6ttCqT
✅Finish the on-chain task with ZERO cost on zetablockchain Testnet, follow the guide, and claim your Testnet token.
👉https://tp-lab.tptool.pro/tokenpocket-christmas/?locale=en#/
✅Tutorial
👉https://medium.com/@zetaswapdex/zetaswap-and-tokenpocket-christmas-campaign-tutorial-4da9812bc3cd
【Details】https://twitter.com/TokenPocket_TP/status/1740366182635692379
【Powered By】Crypto Box
Quoted ChatGM_Official : ❄️JOIN https://galxe.com/TokenPocket/campaign/GCgP6tt9zy on Galxe and get to chance to share $150,000 in ZETA #TokenPocketChristmas Gift!
👉https://tp-lab.tptool.pro/tokenpocket-christmas/?locale=en#/
👉https://www.tokenpocket.pro/
【Details】https://twitter.com/TokenPocket_TP/status/1739132332236566541
【Powered By】Crypto Box
#TokenPocketChristmas $9,000 Random Rewards on Owlto_Finance!
✅ Bridge between any network on https://owlto.finance/bridge?channel=2484
✅ Connect with your TokenPocket Wallet on Owlto
✅ Follow Owlto_Finance and TokenPocket_TP
✅ Q'RT this tweet with #TokenPocketChristmas.
⏰ Dec 20th - Dec 26th, 2023
💎 Bridge and get a chance to win up to $100 per day at once!
【Details】https://twitter.com/TokenPocket_TP/status/1737681781900578863
【Powered By】Crypto Box
🧑🎄Merry Christmas! #TPFam#TokenPocketChristmas
❄️May your wallets be filled with joy, your transactions be seamless, and may the blockchain of happiness bless you with endless prosperity.
Wishing you a Merry Christmas and a crypto-filled New Year! 🚀🌟
👉https://www.tokenpocket.pro/
【Details】https://twitter.com/TokenPocket_TP/status/1738895386377601385
【Powered By】Crypto Box
#TokenPocketChristmas is listed on Galxe's Banner!
👉https://galxe.com/TokenPocket/campaign/GCc28ttYTk
🎅Welcome to join #TokenPocketChristmas and get a chance to share $150,000 in #ZETA! zetablockchain
【Details】https://twitter.com/TokenPocket_TP/status/1738034178892132511
【Powered By】Crypto Box
🎁 Share $150,000 in ZETA! zetablockchain
Join ChatGM_Official Journey with TokenPocket_TP, one of the events on #TokenPocketChristmas!
👉https://galxe.com/TokenPocket/campaign/GCgP6tt9zy
👉https://tp-lab.tptool.pro/tokenpocket-christmas/?locale=en#/
ChatGM uses Interactive AI to make web3 simple and accessible to everyone. With EVM/BTC wallets as digital IDs, ChatGM offers encrypted texting, voice, and video calls across crypto wallets, Telegram, and WhatsApp.
🌊Tips, #ChatGM OAT is representing the POAP of ChatGM OG, make sure you already minted the OAT. Converting POAP into GM Points enables users to exchange these points for GM tokens during future airdrop events, based on the pool's conversion rate.
【Details】https://twitter.com/TokenPocket_TP/status/1745747011113300328
【Powered By】Crypto Box
🆕 Galxe now fully supports #TokenPocket login!
👉https://extension.tokenpocket.pro/
Galxe is the leading platform for building the Web3 community.
🔥Follow TokenPocket Space and Get Ready for the #TokenPocketChristmas on #Galxe!
👉https://galxe.com/TokenPocket
Details:
👉https://twitter.com/Galxe/status/1729918366012600584
👉https://twitter.com/TokenPocket_TP/status/1730068829311774726
💥We’re excited to announce that #TokenPocketChristmas winners can claim rewards at
@ZetaBlockchain
mainnet launch! #ZetaChain
Check if you are on the first-round winner list
👉https://docs.google.com/spreadsheets/d/1zqZx0BHE0gVBn8doFhRAdFBaQrwoxzPbwu2CYCOkvhs/edit#gid=0
How to claim your #ZETA?
1️⃣Download TokenPocket Wallet
👉https://tokenpocket.pro
👉https://extension.tokenpocket.pro
2️⃣Create/import/sync your #ZetaChain wallet on TokenPocket after mainnet launch!
3️⃣Share the news with your friends if you are on the winner list! (RT, Like, Comment) 👉https://twitter.com/TokenPocket_TP/status/1752147092942749951
When to get your ZETA?
⏰The rewards will be distributed at the same time of #ZetaChain airdrop claim opens this week.
All participating user data from #TokenPocket are also whitelisted to get a boost in the first XP campaign on ZetaHub. Learn more about the 10% of the total ZETA token supply for community rewards: https://twitter.com/zetablockchain/status/1750758520637804707
#TokenPocketChristmas ZoomManor #Giveaway!
🫶To Enter👇
https://galxe.com/TokenPocket/campaign/GCDC5ttVi6
🧙♂️ZoomManor is a farm management🐣🌾and home-building game built on #X1▪️and multi-chains in the future🏡 ZoomManor
🪂50 winners will share 500 USDT and 20 winners will share 20 Hero Mystery Boxes!
【Details】https://twitter.com/TokenPocket_TP/status/1739547968599142506
【Powered By】Crypto Box
😍Are you hooked on #Solana? Dive into the world of high-speed transactions and decentralized greatness! 🚀 Embrace the Solana thrill!
Now, $SILLY as one of the top trending tokens on solana, is listed on TokenPocket wallet! #SillyDragon
Empowering you with real-time price updates and dynamic percentage changes! Stay informed, stay ahead. 📈✨#TokenPocketChristmas#TokenPocket
👉https://www.tokenpocket.pro/
【Details】https://twitter.com/TokenPocket_TP/status/1739203251525103701
【Powered By】Crypto Box