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

Резултати

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

Пребарај: #mbox

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

@CoinSonar · Post #244164 · 18.04.2026 г., 12:08

#MBOX | Volume spike (USDT PAIR) 13 times the average volume 173.59K USDT traded in 15 min └Selling vol: 122.60K USDT 🔴 Boost score: 1/10 24h Vol: 1.22M USDT (Binance) Price: 0.0152 (-2.5% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #244112 · 18.04.2026 г., 10:08

#MBOX | Volume spike (USDT PAIR) 10 times the average volume 128.49K USDT traded in 15 min └Buying vol: 74.31K USDT 🟢 Boost score: 5/10 24h Vol: 1.22M USDT (Binance) Price: 0.0157 (-2.5% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #244047 · 18.04.2026 г., 07:48

#MBOX | Volume spike (USDT PAIR) 29 times the average volume 125.59K USDT traded in 5 min └Selling vol: 69.68K USDT 🔴 Boost score: 1/10 24h Vol: 1.22M USDT (Binance) Price: 0.0154 (-2.5% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243990 · 18.04.2026 г., 05:48

#MBOX | Volume spike (USDT PAIR) 10 times the average volume 131.44K USDT traded in 15 min └Selling vol: 66.19K USDT 🔴 Boost score: 1/10 24h Vol: 1.22M USDT (Binance) Price: 0.0142 (-2.5% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243446 · 17.04.2026 г., 04:47

#MBOX | Volume spike (USDT PAIR) 10 times the average volume 129.11K USDT traded in 15 min └Buying vol: 88.30K USDT 🟢 Boost score: 6/10 24h Vol: 1.22M USDT (Binance) Price: 0.0153 (-2.5% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28566 · 21.03.2025 г., 08:47

#MBOX/USDT analysis : #MBOX is currently in a downtrend, trading below the 200 EMA. The price has been rejected from the resistance zone and broken below the trendline. It is expected to decline further and test the swing low. TF : 2h Entry : $0.0845 Target : $0.0756 SL : $0.0900

Hashtags

Pro Analysis

@proanalysistrader · Post #28391 · 16.01.2025 г., 08:05

#MBOX/USDT analysis : #MBOX is in a downtrend, consistently making lower lows (LLs) and lower highs (LHs) below the 200 EMA. Currently, the price is retracing towards the 200 EMA and a resistance zone. It is anticipated that the price will test this zone before reverting back to continue its bearish momentum, potentially reaching lower levels. TF : 4h Entry : $0.1865 Target : $0.1566 SL : $0.2037

Hashtags

Pro Analysis

@proanalysistrader · Post #27984 · 04.10.2024 г., 13:28

#MBOX/USDT analysis : #Mbox is currently in a downtrend, trading below the 200 EMA. The price is forming a structure of lower lows and lower highs. It is facing rejection from the resistance zone, which suggests a potential reversal that could reinforce its bearish trend and test previous lows. TF : 15min Entry : $0.1332 Target : $0.1269 SL : $0.1366

Hashtags

American Crypto©

@americancryptotrading · Post #27460 · 05.12.2025 г., 10:37

🇺🇸#MBOX/USDT is bouncing from the support zone inside the descendingchannel pattern on the weekly chart🔍 Looks bullish✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27179 · 09.03.2025 г., 15:28

🇺🇸#MBOX/USDT has found support at the lowerborder of the descendingchannel pattern on the weekly timeframe👀 Looking for a rise🐃 American Crypto©

Hashtags

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