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

Резултати

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

Пребарај: #mnt

当前筛选 #mnt清除筛选
American Crypto©

@americancryptotrading · Post #27475 · 20.12.2025 г., 10:32

🇺🇸#MNT/USDT is retesting the broken s/rzone on the 3D timeframe🧐 More upside after the bounce✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27427 · 03.11.2025 г., 10:02

🇺🇸#MNT/USDT has retested the s/rzone on the 3D chart💁‍♂️ Bullish case✈️ American Crypto©

Hashtags

Bitcoin Bullets®

@bitcoinbuliets · Post #13503 · 21.04.2026 г., 04:03

#MNT Market Analysis MNT/USDT remains bearish with price trading in the lower half of Bollinger Bands and MACD signaling downward momentum. RSI near 42 shows weak buying interest, confirming the bearish structure with resistance at 0.6458 holding firm. Bulls need to hold above 0.6099 to target a retest of 0.6458 and potentially 0.6615. Bears stay in control below 0.6458, risking a drop to 0.6099 and a breakdown of key support. Watch 0.6099 for the next directional cue. --- ➖➖➖➖➖➖➖ Bitcoin Bullets® Trading

Hashtags

Bitcoin Bullets®

@bitcoinbuliets · Post #13496 · 20.04.2026 г., 20:03

#MNT Market Analysis MNT/USDT remains bearish with price hovering in the lower half of the Bollinger Bands and RSI near 41, confirming weak momentum. MACD is bearish, reinforcing sellers' control after recent lower highs. Bulls need to hold 0.6099 to aim for a rebound toward 0.6614 resistance. Bears gain edge on a break below 0.6099, risking a deeper drop to lower supports. Watch 0.6099 closely for the next directional move. --- ➖➖➖➖➖➖➖ Bitcoin Bullets® Trading

Hashtags

Bitcoin Bullets®

@bitcoinbuliets · Post #13488 · 20.04.2026 г., 04:03

#MNT Market Analysis MNT/USDT shows a bearish structure with price hovering near the lower Bollinger Band and RSI deep in oversold territory at 28.5. MACD confirms downside momentum with no signs of reversal yet. Bulls need to hold above 0.6539 to target resistance at 0.6679 and potentially test 0.6767. Bears stay in control below 0.6539, risking a drop further from key support levels. Watch 0.6539 closely for next directional clues. --- ➖➖➖➖➖➖➖ Bitcoin Bullets® Trading

Hashtags

Bitcoin Bullets®

@bitcoinbuliets · Post #13481 · 19.04.2026 г., 20:03

#MNT Market Analysis MNT/USDT remains bearish with price hugging the lower Bollinger Band and RSI near 36, signaling weak momentum. MACD confirms the downside pressure as the pair struggles below key resistances around 0.6615-0.6679. Bulls need to hold above 0.6538 to build a base and target a retest of 0.6679. Bears take control if 0.6538 breaks, risking a drop toward 0.642 and lower support zones. Watch 0.6538 closely for direction. --- ➖➖➖➖➖➖➖ Bitcoin Bullets® Trading

Hashtags

Beyond Crypto Worldwide

@beyond_crypto_uk · Post #214 · 08.05.2024 г., 19:25

😺How are your cats doing with Catizen? More than 5,000,000 cat lovers are already participating in the project, and thousands are joining every day. Catizen has entered into a partnership with the Mantle Network (#MNT). Our goal is to make Catizen a bridge not only between Telegram and the TON blockchain, but also between the Ethereum ecosystem (#ETH) and TON. 💸If you're still not making easy money with no investment, then quickly follow the link here! Beyond Crypto

Hashtags

UnionPay currency

@unionpay_currency · Post #16308 · 28.04.2026 г., 07:01

Свежий расчет на 28.04.2026 10:00 для Монгольского тугрика #расчеты#MNT Каждый день новые расчеты в @UnionPay_currency Вся информация про UnionPay есть в https://unionpay.glide.page Информационная поддержка: @UnionPay_info

UnionPay currency

@unionpay_currency · Post #16204 · 21.04.2026 г., 07:02

Свежий расчет на 21.04.2026 10:00 для Монгольского тугрика #расчеты#MNT Каждый день новые расчеты в @UnionPay_currency Вся информация про UnionPay есть в https://unionpay.glide.page Информационная поддержка: @UnionPay_info

UnionPay currency

@unionpay_currency · Post #16056 · 14.04.2026 г., 07:01

Свежий расчет на 14.04.2026 10:00 для Монгольского тугрика #расчеты#MNT Каждый день новые расчеты в @UnionPay_currency Вся информация про UnionPay есть в https://unionpay.glide.page Информационная поддержка: @UnionPay_info

UnionPay currency

@unionpay_currency · Post #15913 · 07.04.2026 г., 07:01

Свежий расчет на 07.04.2026 10:00 для Монгольского тугрика #расчеты#MNT Каждый день новые расчеты в @UnionPay_currency Вся информация про UnionPay есть в https://unionpay.glide.page Информационная поддержка: @UnionPay_info

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