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

Резултати

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

Пребарај: #fundinground

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

@CryptoM · Post #64477 · 09.04.2026 г., 02:04

🚀 Anthropic Completes Secondary Market Equity Sale Anthropic has recently completed a secondary market equity sale, with some employees selling a small portion of their shares to investors. According to Odaily, the limited willingness of employees to sell resulted in several investors not receiving their planned share allocations. The transaction was priced in line with the company's latest funding round valuation from February this year, maintaining Anthropic's current valuation at $350 billion, excluding the $30 billion raised in this round. #Anthropic#EquitySale#SecondaryMarket#Employees#Investors#FundingRound#Valuation#TechNews

Crypto M - Crypto News

@CryptoM · Post #64471 · 09.04.2026 г., 01:47

🚀 OpenAI CFO Reports Strong Retail Investor Interest in Recent Funding Round OpenAI's Chief Financial Officer, Sarah Friar, revealed in an interview with CNBC that the company has begun exploring opportunities with retail investors in its latest funding round. According to Odaily, Friar noted that there has been a very strong demand from individual investors. Friar also mentioned that OpenAI plans to allocate a portion of shares for retail investors during its initial public offering (IPO). #OpenAI#CFO#retailinvestors#fundinground#IPO#SarahFriar#individualinvestors#CNBC

Crypto M - Crypto News

@CryptoM · Post #64949 · 10.04.2026 г., 12:06

🚀 Libeara Secures New Funding Round for Digital Infrastructure Development Libeara, a platform focused on the tokenization of real-world assets, has announced the completion of a new funding round. According to Odaily, the investment was made by AlloyX Ventures, a venture capital firm under Nasdaq-listed SOLOWIN HOLDINGS. The specific amount of the investment has not been disclosed. The newly acquired funds will be directed towards advancing compliant digital infrastructure. #Libeara#FundingRound#DigitalInfrastructure#Tokenization#RealWorldAssets#AlloyXVentures#SOLOWINHOLDINGS#VentureCapital

Venture Village Wall 🦄

@venturevillagewall · Post #3493 · 19.12.2024 г., 13:58

Vibly Fundraising Highlights Vibly has successfully raised $734.92K in its latest funding round, which took place on December 19, 2024. For more information, visit their website: Vibly. #Vibly#Funding#Investment#Startup#Tech#Finance#Innovation#Business#FundingRound#Capital#Growth#Entrepreneurship#Market#Development#Strategy#VentureCapital #2024

Venture Village Wall 🦄

@venturevillagewall · Post #3357 · 18.12.2024 г., 12:07

Fix AI Secures $500K Funding 🔹 Fix AI has successfully closed a funding round amounting to $500K on December 4, 2024. For more details, visit their website: Fix AI #Funding#AI#Investment#Tech#Startups#Innovation#Finance#Capital#Growth#Venture #2024 #Business#Entrepreneurship#Development#Project#Startup#Ecosystem#Technology#FundingRound#Launch

Venture Village Wall 🦄

@venturevillagewall · Post #3419 · 18.12.2024 г., 12:11

Tyme Raises $250M Round #Tyme has successfully raised a substantial $250 million in funding, closing the round on December 17, 2024. For more details, visit Tyme's website. #Funding#Tyme#Investment#Capital#Finance#Business#Technology#Startups#FundingRound#VentureCapital #2024 #Growth#Innovation#CapitalRaising#TechNews#Market#Entrepreneurship#StartUpFunding#FinancialServices

Venture Village Wall 🦄

@venturevillagewall · Post #3571 · 20.12.2024 г., 09:33

Ashry Steel Group Secures Funding *Ashry Steel Group* raises $46.15M in its latest funding round on December 19, 2024. For more details, visit their website here. #AshrySteelGroup#Funding#Investment#SteelIndustry#Finance#Growth#Capital#Business#Economy#Market#IndustryNews#Corporate#InvestmentRound#Startup#FundingRound#Entrepreneurship#Innovation

Venture Village Wall 🦄

@venturevillagewall · Post #3359 · 18.12.2024 г., 12:07

Aditto Secures $500K Funding Aditto raises $500K on December 4, 2024, focusing on custom-generated landing pages and search ads. For more information, visit Aditto. #Aditto#Funding#LandingPages#SearchAds#Investment#Startup#Tech#Marketing#DigitalMarketing#VentureCapital#OnlineAdvertising#Business#Innovation#Growth#Entrepreneurship#FundingRound

Venture Village Wall 🦄

@venturevillagewall · Post #4196 · 20.02.2025 г., 04:00

Aptos Accuses Monad of Code Theft Aptos research director Alexander Spiegelman has accused Monad of plagiarizing Aptos' open-source code. Monad co-founder James Hunsaker denied these claims, stating that BlockSTM is an extension and that no Aptos code has been utilized. Meanwhile, Monad recently secured $225M funding led by Paradigm, reaching a $3B valuation. More details: Wu Blockchain News #Aptos#Monad#Blockchain#Investing#Funding#Paradigm#SOL#Ethereum#DeFi#Crypto#VC#Tech#Innovation#OpenSource#FundingRound#Inflation#Protocols#Development#DEX#SecondSwap

Venture Village Wall 🦄

@venturevillagewall · Post #3398 · 18.12.2024 г., 12:10

Svakarma Finance Raises $10.4M Svakarma Finance successfully raised $10.40 million in funding on December 13, 2024. For more details, visit their website. #Funding#Finance#Svakarma#Investment#Capital#Startup #2024 #Market#Growth#Innovations#Loans#FinanceTech#DigitalFinance#Fintech#VentureCapital#Equity#FundingRound#FinancialServices#Economy

12
ПретходнаСтраница 1 од 2Следна