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

Резултати

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

Пребарај: #shib

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

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

#SHIB | Volume spike (USDT PAIR) 9 times the average volume 488.35K USDT traded in 15 min └Selling vol: 255.32K USDT 🔴 Boost score: 1/10 24h Vol: 4.72M USDT (Binance) Price: 0.00000635 (-4.2% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28511 · 02.03.2025 г., 16:57

#SHIB/USDT analysis : The price of #SHIB has recently broken out of its trendline, indicating a potential bullish momentum. While a retracement to the 200 EMA is expected, the overall sentiment suggests that the price is likely to move upwards and test the swing high level. TF : 4h Entry : $0.00001480 Target : $0.00001734 SL : $0.00001313

Hashtags

Pro Analysis

@proanalysistrader · Post #28225 · 19.11.2024 г., 12:45

#SHIB/USDT analysis : #SHIB has successfully broken out of the trendline, demonstrating a strong bullish movement. It is anticipated that this upward momentum will continue, allowing the price to test higher levels. TF : 1D Entry : $0.00002536 Target : $0.00004567 SL : $0.00001827

Hashtags

American Crypto©

@americancryptotrading · Post #27615 · 10.05.2026 г., 08:40

🇺🇸#SHIB/USDT is facing the upperboundary of the fallingwedge pattern on the 3D timeframe👨‍💻 A confirmed breakout could lead to massive gains🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27392 · 30.09.2025 г., 09:24

🇺🇸#SHIB/USDT has retested the upperborder of the fallingwedge pattern on the 2D chart🧐 The rally is coming🚀 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27334 · 06.08.2025 г., 09:08

🇺🇸#SHIB/USDT is currently trading at the s/rzone on the weekly chart👀 Bullish mode is on if we bounce📈 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27206 · 04.04.2025 г., 21:47

🇺🇸#SHIB/USDT is trading within the descendingchannel pattern on the daily timeframe🔍 Looks bullish📈 American Crypto©

Hashtags

Coinlegs Cryptocurrency Signals

@coinlegs · Post #9982 · 24.02.2024 г., 08:21

#SHIB -%5 in 6hrs 🤑🤑 Algorithmic bots on our Discord server print us instant money. Thanks to Hey CoinLegs signals, we were able to catch short-term signals instantly. Join us to get access to these and many other algorithmic auto signals 👇 https://discord.gg/8RKtAA9cxZ

Hashtags

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