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

Резултати

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

Пребарај: #gala

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

@CoinSonar · Post #244088 · 18.04.2026 г., 09:00

#GALA | Volume spike (USDT PAIR) 9 times the average volume 200.07K USDT traded in 15 min └Buying vol: 123.38K USDT 🟢 Boost score: 5/10 24h Vol: 1.96M USDT (Binance) Price: 0.00347 (-2.2% in 24h)

Hashtags

Coin Sonar

@CoinSonar · Post #243676 · 17.04.2026 г., 13:27

#GALA | Volume spike (USDT PAIR) 9 times the average volume 197.81K USDT traded in 15 min └Buying vol: 121.37K USDT 🟢 Boost score: 3/10 24h Vol: 1.96M USDT (Binance) Price: 0.00342 (-2.2% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28387 · 14.01.2025 г., 16:21

#GALA/USDT analysis : #GALA is currently consolidating above the support zone and the 200 EMA. A price bounce is anticipated, allowing for a continuation of its bullish momentum aimed at testing previous highs. Wait for a breakout above the $0.03736 level for a long entry. TF : 1D Entry : $0.03736 Target : $0.06650 SL : $0.02860

Hashtags

Pro Analysis

@proanalysistrader · Post #28314 · 05.12.2024 г., 07:19

#GALA/USDT analysis : #GALA is in an uptrend, forming higher highs and higher lows. After retracing to the 200 EMA and a support zone, the price bounced back and broke the trendline. This suggests a bullish continuation, with expectations to test previous highs. TF : 15min Entry : $0.05933 Target : $0.06655 SL : $0.05497

Hashtags

Pro Analysis

@proanalysistrader · Post #28223 · 18.11.2024 г., 17:48

#GALA/USDT Analysis- After forming a symmetrical triangle pattern, the price broke out, achieving a 30% gain within three days. Currently, the price has completed a retest and is approaching its previous swing high. If it successfully breaks above this level, it has the potential to rally further by over 45%. T.F.- 1-D ENTRY- 0.0317 SL- 0.02720 TARGET- 0.04640 Note: If the stop-loss is triggered before entry, disregard the trade as the price action may develop differently.

Hashtags

Pro Analysis

@proanalysistrader · Post #27987 · 05.10.2024 г., 14:02

#GALA/USDT analysis : #GALA is in an uptrend, making higher highs (HHs) and higher lows (HLs). The price has recently tested the support zone and is expected to bounce back from there to test the previous swing high. TF : 1D Entry : $0.01984 Target : $0.02441 SL : $0.01824

Hashtags

American Crypto©

@americancryptotrading · Post #27573 · 30.03.2026 г., 09:44

🇺🇸#GALA/USDT is trading near the lowerborder of the fallingwedge on the weekly timeframe💁‍♂️ Looks good to buy✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27552 · 04.03.2026 г., 10:08

🇺🇸#GALA/USDT is facing the lowerborder of the fallingwedge on the weekly chart🧐 Strong upside potential on a bounce🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27512 · 23.01.2026 г., 10:12

🇺🇸#GALA/USDT is holding above the lowerboundary of the fallingwedge pattern on the weekly timeframe💁‍♂️ Strong upside potential on a bounce📈 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27402 · 10.10.2025 г., 08:57

🇺🇸#GALA/USDT is moving inside the descendingtriangle on the weekly chart💁‍♂️ Breakout soon🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27359 · 29.08.2025 г., 09:33

🇺🇸#GALA/USDT is consolidating within the descendingtriangle pattern on the daily timeframe👀 Looks good for the midterm📈 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27302 · 05.07.2025 г., 08:18

🇺🇸#GALA/USDT is facing the supportzone on the weekly timeframe💁‍♂️ Expecting a bounce soon✈️ American Crypto©

Hashtags

123•••56
ПретходнаСтраница 1 од 6Следна