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

Резултати

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

Пребарај: #onboarding

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

@venturevillagewall · Post #3542 · 20.12.2024 г., 09:31

Motion.io Secures $3.17M Funding Motion.io raises $3.17M on December 18, 2024, to enhance their white-label client portals. The funding will support automating client onboarding and improving file, signature, and feedback collection processes. #MotionIo#Funding#ClientPortals#Automation#Onboarding#TechFunding#Feedback#Signatures#WhiteLabel#Startup#Investment

GitHub Trends

@githubtrending · Post #15504 · 19.02.2026 г., 12:00

#other#awesome_list#awesone#distrubuted#global#infra#onboarding#paas#saas#toolbox Free SaaS tools span multiple business functions—from project management (Asana, Trello) and CRM (HubSpot, Zoho) to design (Figma), video conferencing (Zoom), and data analysis—enabling startups and small teams to operate efficiently without upfront costs. Many platforms offer free tiers with essential features, allowing you to test tools before upgrading. This approach lets you build a complete tech stack affordably, scale gradually as your business grows, and allocate budget toward features that directly drive revenue rather than basic software licenses. https://github.com/LlamaGenAI/awesome-free-saas

Venture Village Wall 🦄

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

Dfns Secures $16M Funding Dfns, the wallet-as-a-service (WaaS) platform, has raised $16 million in funding as of December 18, 2024. The platform is designed to simplify digital asset operations and facilitate safe crypto onboarding for leading organizations. #Dfns#Funding#WaaS#DigitalAssets#Crypto#Operations#Onboarding#Investment#Security#Technology#Finance#Blockchain#Startups#Innovation#Market#Users#Ecosystem#Wallet#Services#Platform#Growth

Venture Village Wall 🦄

@venturevillagewall · Post #4267 · 28.02.2025 г., 10:00

Uniswap Expands Crypto-to-Fiat Options Uniswap collaborates with Robinhood, MoonPay, and Transak to enable seamless crypto-to-fiat transactions. Users across 180+ countries can convert crypto and deposit funds directly into bank accounts via the mobile wallet. This feature will soon be available on the browser extension and web version. For more details, visit Leviathan News. #Uniswap#Crypto#Robinhood#MoonPay#Transak#Banking#Fiat#DEX#Blockchain#Finance#Tech#Global#Innovation#Payments#Wallet#Transactions#Defi#Onboarding#CryptoAdoption#VC