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

Резултати

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

Пребарај: #rif

当前筛选 #rif清除筛选
Pro Analysis

@proanalysistrader · Post #28216 · 17.11.2024 г., 06:24

#RIF/USDT analysis : Following a significant decline of -83% from its all-time high, the price has found support at the $0.0600 level. Subsequently, it has bounced back and successfully broken above the trendline, indicating a confirmation of anticipated bullish momentum. It is expected that the price will continue this upward trajectory and test the previous swing high. TF : 1W Entry : $0.1117 Target : $0.3377 SL : $0.0766

Hashtags

Pro Analysis

@proanalysistrader · Post #27951 · 22.09.2024 г., 03:30

#RIF/USDT analysis : #RIF is trading above the support zone and the 200 EMA. The price is anticipated to rebound from this level and proceed to rise, testing the previous swing high. TF : 15min Entry : $0.0977 Target : $0.1007 SL : $0.0956

Hashtags

Alphavave Traders ️️️

@alphavave · Post #3256 · 21.04.2026 г., 00:34

#RIF yielded an impressive 3,010% return in a few days ⭐ If you used 200x leverage on this signal, you would've made a mind-blowing profit of 12,040%🤩 $50💰 would return $750💵 $50 💰 would return $1,500 💲 $50💰 would return $6,000💰 When you understand the market like we do, every move becomes predictable With 5+ years of trading experience, we spot these moves before they happen 💯 If you want daily signals like this, DM me to join our private group! 👇 @Kevindexter✅

Hashtags

Binance crypto champions

@binancecryptochampions · Post #3087 · 11.02.2026 г., 03:39

💎#RIF/USDT 💎 Signal Type: Regular (Long) Leverage: Cross (20.0x) Amount: 2.0% Entry Targets: 1) 0.04535 Take-Profit Targets: 1) 0.04635 2) 0.04800 3) 0.05065 Stop Targets: 1) 0.04250 🦋 Published by: @Trading_exp🦋 Join_vip: @Crypto_Futures_Spot_Payment_bot 🚫 Don't forget to Secure profit 🚫

Hashtags

Alex Kowalski | Trade

@kowalskitrade · Post #751 · 12.09.2024 г., 16:13

#RIF I'm expecting roughly this kind of movement on this asset, either with streaming start ups behind our magnets from above. 📈Sign up on Bybit to trade with me

Hashtags

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