@itsmealexaliza · Post #368 · 18.10.2022 г., 06:31
Today arm pro offers only #Lifetime Key Rs₹ 1500 Instantly key Buy key dm @alexalizaca
Hashtags
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
Пребарај: #lifetime
@itsmealexaliza · Post #368 · 18.10.2022 г., 06:31
Today arm pro offers only #Lifetime Key Rs₹ 1500 Instantly key Buy key dm @alexalizaca
Hashtags
@cryptocurreniesbtc · Post #23052 · 10.08.2024 г., 15:57
💵 Subscription fee #VIP Spot only 👇💰👇💰👇💰👇 #month - $200 - $700 #lifetime 📞 To join every service based on your needs, contact me: ✅ @TopTraden
@cryptocurreniesbtc · Post #23003 · 08.08.2024 г., 02:51
💵 Subscription fee #VIP Spot only 👇💰👇💰👇💰👇 #month - $200 - $700 #lifetime 📞 To join every service based on your needs, contact me: ✅ @TopTraden
@cryptocurreniesbtc · Post #22878 · 20.07.2024 г., 10:31
💵 Subscription fee #VIP Spot only 👇💰👇💰👇💰👇 #month - $200 - $700 #lifetime 📞 To join every service based on your needs, contact me: ✅ @TopTraden
@cryptocurreniesbtc · Post #22840 · 10.07.2024 г., 15:31
💵 Subscription fee #VIP Spot only 👇💰👇💰👇💰👇 #month - $200 - $700 #lifetime 📞 To join every service based on your needs, contact me: ✅ @TopTraden
@cryptocurreniesbtc · Post #22804 · 03.07.2024 г., 16:15
💵 Subscription fee #VIP Spot only 👇💰👇💰👇💰👇 #month - $200 - $700 #lifetime 📞 To join every service based on your needs, contact me: ✅ @Wh_VIPCryptocurrenc
@cryptocurreniesbtc · Post #22775 · 26.06.2024 г., 08:48
💵 Subscription fee #VIP Spot only 👇💰👇💰👇💰👇 #month - $200 - $700 #lifetime 📞 To join every service based on your needs, contact me: ✅ @TopTraden
@cryptocurreniesbtc · Post #22739 · 20.06.2024 г., 19:12
💵 Subscription fee #VIP Spot only 👇💰👇💰👇💰👇 #month - $200 - $700 #lifetime 📞 To join every service based on your needs, contact me: ✅ @TopTraden
@itsmealexaliza · Post #396 · 28.10.2022 г., 07:28
Today arm Ultra offers only #New Offers #Lifetime Key Rs₹ 1299 lifetime Rs₹ 999 Yearly Rs ₹700 6 month Rs₹ 200 monthly For dollars $22 lifetime $15 Yearly $ 5 monthly Global Server Noo Need VPN #noVpnNeedAnymore Note 📝 It's Global Server So Need Vpn Instantly key Buy key dm @alexalizaca Note 📝 This Is Arm Pro Source it's Not Arm Pro. So don't be confuse. We want function with Cheap rate that's why it's posted. Some hater tell copy version. it's source arm pro. With full function cheap rate.
Hashtags
@cryptocurreniesbtc · Post #22648 · 01.02.2024 г., 04:13
💵 Subscription fee #VIP 👇💰👇💰👇💰👇 #month - $150 3 #months - $300 6 #months - $600 #VIP, #VIP_ Plus #VIP#VIP_PLUS - $2000 #lifetime 📞 To join every service based on your needs, contact me: ✅ @VICryptocurrenc
@cryptocurreniesbtc · Post #22617 · 30.01.2024 г., 10:27
💵 Subscription fee #VIP 👇💰👇💰👇💰👇 #month - $150 3 #months - $300 6 #months - $600 #VIP, #VIP_ Plus #VIP#VIP_PLUS - $2000 #lifetime 📞 To join every service based on your needs, contact me: ✅@Wh_VIPCryptocurrency
@cryptocurreniesbtc · Post #22139 · 14.11.2023 г., 22:00
💵 Subscription fee #VIP 👇💰👇💰👇💰👇 #month - $150 3 #months - $300 6 #months - $600 #VIP, #VIP_ Plus #VIP#VIP_PLUS - $2000 #lifetime We publish the strongest signals on the VIP and VIP_PLUS channel 4-8 per day, the average profit per trade ranges from 150% to 300% and the risk ratio is very low, the success rate of trades is high, almost 97%. We provide support and assistance all the time to help you make good daily profits Signal type is #Futures and #Spot 📞 To join every service based on your needs, contact me: ✅@Wh_VIPCryptocurrency