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

Резултати

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

Пребарај: #ens

当前筛选 #ens清除筛选
Coin Sonar

@CoinSonar · Post #243334 · 16.04.2026 г., 21:49

#ENS | Volume spike (USDT PAIR) 12 times the average volume 129.53K USDT traded in 15 min └Selling vol: 113.21K USDT 🔴 Boost score: 1/10 24h Vol: 981.00K USDT (Binance) Price: 6.17 (-3.3% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243271 · 16.04.2026 г., 18:53

#ENS | Volume spike (USDT PAIR) 167 times the average volume 114.35K USDT traded in 1 min └Selling vol: 57.63K USDT 🔴 Boost score: 1/10 24h Vol: 981.00K USDT (Binance) Price: 6.17 (-3.3% in 24h)

Hashtags

CryptoBull_360™

@cryptobull_360 · Post #48363 · 15.02.2026 г., 13:55

#ENS is rebounding from the support trendline of the descending channel, with the Ichimoku Cloud acting as a resistance barrier. A decisive breakout above both the channel and the cloud would confirm bullish momentum.

Hashtags

Pro Analysis

@proanalysistrader · Post #28383 · 12.01.2025 г., 05:38

#ENS/USDT analysis : #ENS is currently in an uptrend, consistently reaching new highs while trading above the 200 EMA. The price is now retracing towards the 200 EMA and a significant support level. It is expected that the price will test this zone and rebound, which should support the continuation of bullish momentum and will lead to a retest of previous highs. TF : 1D Entry : $30.35 Target : $47 SL : $23.38

Hashtags

Pro Analysis

@proanalysistrader · Post #28309 · 04.12.2024 г., 11:33

#ENS/USDT analysis : #ENS is currently in an uptrend, trading above the 200 EMA. The price has recently bounced back from the 200 EMA, suggesting a continuation of its bullish momentum and potential testing of higher levels. For a long entry, it is advisable to wait for a retracement to optimize the entry point. TF : 30min Entry : $43 Target : $48 SL : $38

Hashtags

American Crypto©

@americancryptotrading · Post #27516 · 27.01.2026 г., 10:59

🇺🇸#ENS/USDT is holding above the supportzone on the 3D chart🧐 Recovery phase is starting🚀 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27234 · 30.04.2025 г., 10:25

🇺🇸#ENS/USDT is challenging the upperborder of the broadeningwedge on the daily chart🧐 Looking for a breakout🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27103 · 31.12.2024 г., 13:08

🇺🇸#ENS/USDT is retesting the s/rzone on the weekly timeframe👨‍💻 To the moon after bounce🚀 American Crypto©

Hashtags

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