@realcombatlvl · Post #24175 · 15.07.2025 г., 22:31
Remember when Trump Did Nothing during BLM... #israelFirst
Hashtags
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
Пребарај: #israelfirst
@realcombatlvl · Post #24175 · 15.07.2025 г., 22:31
Remember when Trump Did Nothing during BLM... #israelFirst
Hashtags
@realcombatlvl · Post #24605 · 02.08.2025 г., 17:27
America is currently experiencing effects of the #KalergiPlan Cloward Piven Strategy Both the left and right made this possible only through the Uniparty and the liars covering for them. Remember as hrc said #israelFirst
Hashtags
@marx21news · Post #10092 · 01.04.2026 г., 14:44
🇮🇷 Iran: Pezeškiyān cita le proteste "No Kings" e accusa: "Gli USA sono stanchi della politica Israel First" In piena guerra contro l'Iran, il presidente Mas'ud Pezeškiyān lancia un messaggio chiaro al popolo americano. Riprendendo le proteste "No Kings" che agitano gli Stati Uniti, il leader iraniano afferma che una parte crescente della società nordamericana rifiuta la subordinazione di Washington alla linea del regime sionista. «Gli esperti di IA negli USA dovrebbero far capire a Trump la realtà delle persone che protestano contro la politica "Israel First"», ha scritto su X. «Sono stanchi che re israeliani governino sulla democrazia americana». Il riferimento è alla crescente inquietudine interna dopo l’aggressione USA-Israele contro Teheran, scatenata dall’assassinio dell’ayatollah Khamenei il 28 febbraio. Secondo Teheran, i bombardamenti su obiettivi civili e militari hanno causato vittime e danni ingenti, mentre le rappresaglie iraniane con missili e droni hanno colpito basi statunitensi e israeliane. Pezeškiyān invita a non confondere i governi con i popoli: “Il popolo americano è arrabbiato. Ascoltate il vostro Paese”. #Iran#USA#NoKings#IsraelFirst#Tasnim#Geopolitica https://www.marx21.it/internazionale/iran-pezeskiyan-cita-le-proteste-no-kings-e-afferma-che-gli-statunitensi-respingono-la-politica-israel-first/
@CryptoM · Post #65129 · 11.04.2026 г., 08:34
🚀 Iran's Vice President Comments on Potential U.S. Negotiations On April 11, Iran's First Vice President Aref expressed on social media that negotiations between Iran and U.S. representatives in Islamabad, Pakistan, could lead to a mutually beneficial agreement. According to BlockBeats, Aref noted that if the U.S. representatives prioritize 'America First,' the chances of reaching a favorable agreement increase. However, if the representatives prioritize 'Israel First,' no agreement will be achieved, and Iran will continue to defend itself more resolutely than before, potentially leading to greater global consequences. #Iran#VicePresident#USNegotiations#Pakistan#AmericaFirst#IsraelFirst#GlobalConsequences#Aref#Diplomacy