TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #65 · 8 апр.

Небольшой трик с регулярными выражениями который редко вижу в чужом коде. Допустим, вам нужно распарсить простой текст и вытащить оттуда пары имя+телефон. Вернуть всё это надо в виде списка словарей. Возьмем очень простой пример текста. >>> text = ''' >>> Alex:8999123456 >>> Mike:+799987654 >>> Oleg:+344456789 >>> ''' Соответственно, для выделения нужных элементов будем использовать группы. Получится такой паттерн: (\w+):([\d+]+) Как мы будем формировать словарь из найденных групп? >>> import re >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append({ >>> "name": match.group(1), >>> "phone": match.group(2) >>> }) >>> print(results) [{'name': 'Alex', 'phone': '8999123456'}, ...] Можно немного сократить запись используя zip >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append(dict(zip(['name', 'phone'], match.groups()))) Но есть способ лучше! Это именованные группы в regex. Можно в паттерне указать имя группы и результат сразу забрать в виде словаря. >>> for match in re.finditer(r"(?P<name>\w+):(?P<phone>[\d+]+)", text): >>> results.append(match.groupdict()) То есть всё что я сделал, это добавил в начале группы (внутри сбокочек) такую запись: (?P<group-name>...) Теперь найденная группа имеет имя и можно обратиться к ней как к элементу списка >>> name = match['name'] Либо забрать сразу весь словарь методом groupdict() >>> match.groupdict() #tricks#regex

Резултати

Пронајдени 7 слични објави

Пребарај: #web3social

当前筛选 #web3social清除筛选
UXLINK

@uxlink_community · Post #918 · 05.05.2026 г., 10:34

🤝 New Partnership: UXLINK x @GXChainGlobal We are excited to collaborate with REI Network, the lightweight, zero-fee L1, to drive the next wave of Web3 mass adoption! 🚀 By combining UXLINK’s Social Growth Layer with REI’s high-performance, EVM-compatible infrastructure, we’re making Web3 more accessible and social than ever. Together, we are building a frictionless future for DeFi, Gaming, and beyond. 🌐✨ #UXLINK#REINetwork#Web3Social#Blockchain

UXLINK

@uxlink_community · Post #854 · 20.02.2026 г., 01:21

The Social Growth Layer for Web3 Mass Adoption.🌐 Thrilled to see @MessariCrypto break down UXLINK's infrastructure model. 🔑Key Takeaways: 1️⃣ UXLINK is the "Onboarding Layer" for partners like @SonicSVM & @DeAgentAI. 2️⃣ We bridge users to emerging AI ecosystems via trusted social graphs. We are the distribution engine for the AI & Web3 economy. 🚀 📖Read the full report below👇https://messari.io/report/uxlink-partnership-growth-model-overview #UXLINK#Messari#Web3Social#Infrastructure

UXLINK

@uxlink_community · Post #914 · 24.04.2026 г., 08:07

🤝 New Partnership: UXLINK 🤝@BrcToTheMoon We’re teaming up with Beatcoin to transform on-chain interactions into measurable economic value! 🚀 By combining Beatcoin’s behavioral primitives with UXLINK’s Social Growth Layer, we’re moving beyond simple metrics to reward genuine, long-term user engagement. 🔗 🔹 Behavior > Outcomes 🔹 Standardized Contributions 🔹 Efficient Incentives #UXLINK#Beatcoin#Web3Social#OnChainValue

UXLINK

@uxlink_community · Post #906 · 09.04.2026 г., 07:48

New Partnership: UXLINK 🤝 C4E We’re excited to partner with @Chain4Energy to bring DePIN & Energy Management into the UXLINK Social Ecosystem! C4E is an AI-powered Layer 1 platform designed for real-world energy and e-mobility management through DePIN infrastructure. ⚡️🤖 Together, we are driving: 🔹 Social-led growth for sustainable energy 🔹 AI-powered intelligent coordination 🔹 Community-driven rewards & engagement Let’s build a greener and more connected Web3 together! 🔗🔋 #UXLINK#C4E#DePIN#Web3Social

UXLINK

@uxlink_community · Post #922 · 09.05.2026 г., 07:32

🤖 Exploring the Future of AI Finance with @HavenAI_! We are excited to partner with Haven AI, the autonomous execution layer bringing AI agents like OpenClaw to on-chain fixed income. Their ability to turn natural language into cross-chain strategies is a game-changer! At UXLINK, we’re excited by innovations that make Web3 more intuitive. Could AI-driven yield be the next big thing for social communities? Stay tuned! 🚀📈 #UXLINK#HavenAI#AI#SocialFi#Web3Social

UXLINK

@uxlink_community · Post #470 · 10.05.2025 г., 05:27

最近の日本Web3界隈で目立つのが、UXLINKの存在感。🇯🇵🔍 CNPとの提携を皮切りに、日本ローカルの強力なIPとの協業が加速⚡ オンチェーン/オフチェーン両方でのコミュニティ展開に加え、 Web2企業とのクロスパートナー戦略も水面下で進行中🤝 “ユーザー起点のWeb3ソーシャル”という文脈で、 UXLINKは今、日本で一番面白い動きをしているかもしれない。🚀 #UXLINK#Web3JP#CNP#ソーシャルレイヤー#CommunityDriven One of the most quietly significant players gaining traction in Japan’s Web3 scene 🇯🇵👀#UXLINK Following its recent collaboration with CNP—a top domestic IP—UXLINK is making inroads across both native Web3 communities and mainstream Web2 circles 🤝 IRL activations, on-chain social dynamics, and a clear long-term strategy signal a serious Japan play 🎯 If you're tracking the rise of social infrastructure in Asia’s Web3 movement, this is one to watch. 📡 #UXLINK#Web3Japan#CommunityLayer#CNP#Web3Social