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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #146 · 16 сеп.

Функция sub в regex может принимать функцию в качестве аргумента repl. 📄 Из документации: If repl is a function, it is called for every non-overlapping occurrence of pattern. The function takes a single match object argument, and returns the replacement string. То есть для каждого совпадения будет вызвана функция для вычисления замены вместо замены на одну и ту же строку для всех совпадений. Иными словами, для замены разных совпадений на разные строки не потребуется запускать re.sub() много раз для каждой строки замены. Достаточно определить функцию, которая вернёт строку для каждого из совпадений. Описание слишком запутанное🤔, давайте лучше рассмотрим на простом примере: Создаем карту замены. То есть какие строки на какие требуется менять. remap = { 'раз': '1', 'два': '2', 'три': '3', 'четыре': '4', 'пять': '5', } Пишем функцию поиска строки для замены. Единственным аргументом будет объект re.Match. Используя данные этого объекта мы вычисляем замену on-the-fly! def get_str(match: re.Match): word = match.group(1) return remap.get(word.lower()) or word Пример текста. text = '''Раз Два Три Четыре Пять Вместе будем мы считать Пять Четыре Три Два Раз Мы считать научим вас ''' Теперь запускаем re.sub и вместо строки замены (repl) подаём имя функции. (Данный паттерн ищет отдельные слова в тексте) >>> print(re.sub(r'(\w+)', get_str, text)) 1 2 3 4 5 Вместе будем мы считать 5 4 3 2 1 Мы считать научим вас Думаю, достаточно наглядно 🤓 #libs#regex

Hashtags

Резултати

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

Пребарај: #databreach

当前筛选 #databreach清除筛选
Venture Village Wall 🦄

@venturevillagewall · Post #4166 · 16.02.2025 г., 13:00

Nippon Steel Hit by Ransomware Attack 💻 Nippon Steel faces serious breach from BianLian, stealing 500GB of sensitive data. The attackers disclosed private info including financial data and personal details of top executives. With over 113,000 employees and $57.5B annual revenue, Nippon Steel is a key player in the steel industry worldwide. The hack adds to the company's challenges in 2025. 📌 For more details, visit Financial Times. #NipponSteel#BianLian#CyberSecurity#DataBreach#Ransomware#SteelIndustry#Japan#TechNews

Crypto M - Crypto News

@CryptoM · Post #65151 · 11.04.2026 г., 13:05

🚀 Lakeview Loan Servicing Reaches $26 Million Settlement Over Data Breach Lakeview Loan Servicing has agreed to a proposed $26 million settlement following a data breach that impacted 2.53 million individuals in the United States. According to NS3.AI, the lawsuit alleges that unauthorized actors gained access to the company's systems, potentially exposing names, Social Security numbers, financial account details, and other personal information. While Lakeview denies any wrongdoing, eligible class members may receive compensation, credit monitoring, and identity protection if the settlement is approved. #DataBreach#Settlement#Privacy#IdentityProtection#FinancialServices#CyberSecurity#USNews

Crypto M - Crypto News

@CryptoM · Post #64880 · 10.04.2026 г., 06:24

🚀 Security Concerns Arise Over LLM Agent API Routers On April 10, Solayer founder @Fried_rice highlighted on social media the growing reliance of large language model (LLM) agents on third-party API routers, which distribute tool call requests to multiple upstream providers. According to BlockBeats, these routers operate as application layer proxies and can access each JSON payload in plaintext during transmission. However, no provider currently enforces encryption integrity protection between the client and upstream models. A study tested 28 paid routers purchased from platforms like Taobao, Xianyu, and Shopify independent sites, along with 400 free routers collected from public communities. The findings revealed that one paid router and eight free routers were actively injecting malicious code. Additionally, two routers deployed adaptive evasion triggers, 17 accessed AWS Canary credentials owned by researchers, and one stole ETH from a private key held by researchers. Further poisoning studies demonstrated that seemingly harmless routers could also be exploited. A leaked OpenAI key was used to generate 100 million GPT-5.4 tokens and over seven Codex sessions. Weaker bait configurations resulted in 2 billion billing tokens, 99 credentials across 440 Codex sessions, and 401 sessions running autonomously in YOLO mode. The research team developed an experimental proxy named Mine, capable of executing all four types of attacks on four public proxy frameworks. They also verified three client defense strategies: fault lock strategy gating, response-side anomaly screening, and append-only transparent logging. #LLM#API#Security#CyberSecurity#Malware#DataBreach#Encryption#Proxy#AI#MachineLearning#ETH

Crypto M - Crypto News

@CryptoM · Post #65165 · 11.04.2026 г., 14:20

🚀 Heart South Reports Potential Data Breach Affecting Thousands Heart South has announced that approximately 46,666 individuals may have been affected by a data breach, with patient information from its network appearing on the dark web. According to NS3.AI, the company has been unable to verify if any specific individual's data was compromised. Notifications regarding the potential breach began being distributed in April 2026. #HeartSouth#databreach#patientdata#darkweb#NS3AI#privacy#cybersecurity#datasecurity#breachnotification#April2026