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

Резултати

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

Пребарај: #lrc

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

@proanalysistrader · Post #28420 · 26.01.2025 г., 10:58

#LRC/USDT analysis : #LRC has retraced to the previous resistance zone, which is now acting as support for the price. From this level, bullish momentum is expected, with the previous swing high serving as the target level for upward movement. TF : 1D Entry : $0.1700 Target : $0.3338 SL : $0.1300

Hashtags

Pro Analysis

@proanalysistrader · Post #27721 · 02.07.2024 г., 05:30

#LRC/USDT analysis - #LRC is currently experiencing a downtrend and is trading below the 200-day Exponential Moving Average (EMA). The price is undergoing a pullback and is anticipated to test the resistance zone close to the 200 EMA shortly before potentially declining further to retest the previous lows. TF : 4h Entry : $0.1890 Target : $0.1601 SL : $0.1994

Hashtags

American Crypto©

@americancryptotrading · Post #27612 · 07.05.2026 г., 08:28

🇺🇸#LRC/USDT is consolidating near the lowerborder of the descendingchannel on the weekly timeframe🧐 A pump is expected if we bounce📈 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27584 · 10.04.2026 г., 09:22

🇺🇸#LRC/USDT has found support at the lowerborder of the descendingchannel formation on the weekly timeframe🔍 Further upside possible after bounce🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27156 · 16.02.2025 г., 17:21

🇺🇸#LRC/USDT is bouncing from the lowerborder of the fallingwedge on the weekly timeframe🔍 Send it📈 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27110 · 05.01.2025 г., 17:51

🇺🇸#LRC/USDT has formed the descendingresistance line on the weekly chart👨‍💻 Looks good for the mid-term📈 American Crypto©

Hashtags

Binance crypto champions

@binancecryptochampions · Post #2942 · 11.12.2025 г., 07:06

✴️Free signal-Futures ✴️ ⚡️⚡️#LRC/USDT⚡️⚡️ Signal Type: Regular (Long) Leverage: Cross (20x) Margin: 2.0% Entry Targets: 1) 0.05500 2) 0.05900 Take-Profit Targets: 1) 0.06200 2) 0.06300 3) 0.06500 Stop Targets: 1) 0.05300 🍁 Published by: @Trading_exp🍁 Join_vip: @Crypto_Futures_Spot_Payment_bot

Hashtags

Crypto

@signal_bitcoins · Post #2813 · 15.02.2024 г., 08:55

#LRC has a symmetrical triangle pattern on Daily time frame,in the case of breakup we will see another huge pump again 🚀 ❄️@signals_bitcoin_crypto❄️ ❄️@Shadow_support0o❄️

Hashtags

Crypto

@signal_bitcoins · Post #2136 · 02.01.2024 г., 10:34

#LRC bounced back from the Demand zone also touched the curve on Weekly time frame,we need a bullish momentum to breakup this pattern 🚀 ❄️@signals_bitcoin_crypto❄️ ❄️@Shadow_support0o❄️

Hashtags

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