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

Резултати

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

Пребарај: #caas

当前筛选 #caas清除筛选
Crypto M - Crypto News

@CryptoM · Post #65244 · 12.04.2026 г., 08:36

🚀 German Hacker Arrested in Bangkok for Cybercrime Activities A 27-year-old German hacker, Noah Christopher, has been arrested in Bangkok, Thailand, facing up to 74 arrest warrants for cybercrimes in Europe. According to Odaily, investigations reveal that between 2021 and 2025, Christopher allegedly developed and operated a ransomware platform and a 'Cybercrime-as-a-Service' (CaaS) system. This included providing tools for distributed denial-of-service (DDoS) attacks, such as Fluxstress and Neldowner, assisting global clients in launching cyberattacks for payment. The ransom payments involved cryptocurrencies and other digital assets, constituting transnational cybercrime activities. His visa has been revoked, and he is currently detained awaiting extradition to Germany. #Cybercrime#Hacker#Ransomware#CaaS#DDoS#Cryptocurrency#Extradition#Thailand#Germany#TransnationalCrime

Crypto M - Crypto News

@CryptoM · Post #64994 · 10.04.2026 г., 13:15

🚀 SimpleChain Secures $15 Million in Seed Funding for RWA Network SimpleChain has announced the successful completion of a $15 million seed funding round. According to Foresight News, the funding was supported by family offices and institutional investors. SimpleChain aims to develop a Real World Asset (RWA) Layer 1 network, positioning itself as an 'Institutional OS' for RWA. The network will be powered by Granular Data and native CaaS, focusing on providing financial-grade infrastructure for the tokenization of real-world assets globally. #SimpleChain#SeedFunding#RWA#Layer1Network#InstitutionalOS#GranularData#CaaS#Tokenization#RealWorldAssets#FinancialInfrastructure