@depressnyashki · Post #4668 · 31.03.2026 г., 08:09
🐈⬛ Печальная депрессняшки Автор: #GoodLuck ➖➖➖ 😫Депрессняшки
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
Пребарај: #goodluck
@depressnyashki · Post #4668 · 31.03.2026 г., 08:09
🐈⬛ Печальная депрессняшки Автор: #GoodLuck ➖➖➖ 😫Депрессняшки
Hashtags
@depressnyashki · Post #4464 · 25.02.2026 г., 16:10
🍉 Южная депрессняшка Автор: #GoodLuck ➖➖➖ 😫Депрессняшки
Hashtags
@depressnyashki · Post #4234 · 18.01.2026 г., 08:10
✍️ Рекомендательная депрессняшка Автор: #GoodLuck ➖➖➖ 😫Депрессняшки
Hashtags
@depressnyashki · Post #4104 · 27.12.2025 г., 06:05
😟 Безграмотная депрессняшка Автор: #GoodLuck ➖➖➖ 😫Депрессняшки
Hashtags
@ethiodjiboutirailway · Post #3001 · 25.08.2025 г., 11:48
We sincerely wish you a wonderful and productive week! May this week bring you success, fulfillment, and the rewards of your hard work. 📢 By clicking the button below, you can apply for the Ethio-Djibouti Railway recruitment program for 100 train crew positions. https://edrsc.com/vacancy-2/ Ethio-Djibouti Railway Connecting Business Find us on: Facebook: https://www.facebook.com/share/15vDenutJd/?mibextid=wwXIfr Telegram: https://t.me/ethiodjiboutirailway Web: https://www.edrsc.com TikTok: @ethiodjiboutirailway Call center: 9546 #Have_a_nice_week #GoodLuck!
Hashtags
@inha_uz · Post #7292 · 14.06.2024 г., 10:39
☄️🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠☄️ Attention all prospective students! Please kindly note that the deadline for the application submission for the second entrance exams of IUT is today, June 14, by 5 PM. This is a last chance for those who want to register for the exam now or re-submit the application in case any mistakes are found after reviewing. 📱Application platform 🖱 Please, don't hesitate to reach out to us if you have any last-minute questions or need assistance with your application via: 📞71 289 99 99 (0400) ✈️@askinhabot ➖➖➖➖➖➖➖➖➖➖ 🎬Application process tutorial Best of luck on your application process and exams! IUT Admission Team #IUTAdmissions2024#ApplicationDeadline#ProspectiveStudents#GoodLuck
@inhayoshlarittifoqi · Post #211 · 14.06.2024 г., 12:02
☄️🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠🔠☄️ Attention all prospective students! Please kindly note that the deadline for the application submission for the second entrance exams of IUT is today, June 14, by 5 PM. This is a last chance for those who want to register for the exam now or re-submit the application in case any mistakes are found after reviewing. 📱Application platform🖱 Please, don't hesitate to reach out to us if you have any last-minute questions or need assistance with your application via: 📞71 289 99 99 (0400) ✈️@askinhabot ➖➖➖➖➖➖➖➖➖➖ 🎬Application process tutorial Best of luck on your application process and exams! IUT Admission Team #IUTAdmissions2024#ApplicationDeadline#ProspectiveStudents#GoodLuck
@lunaeverly · Post #67 · 02.02.2026 г., 08:24
Headed to the office for my first internship! 👩💼☕️ A little nervous, but also excited for new connections and experience. Wish me luck today — I'll definitely need it! Выхожу в офис на первую практику! 👩💼☕️ Немного волнуюсь, но и жду новых знакомств и опыта. Пожелайте мне удачи сегодня — она точно понадобится! #LunaEverly#Internship#Workday#GoodLuck#NewExperience
@googlefactss · Post #40300 · 11.12.2025 г., 19:05
“Knock on wood” is a saying people use to avoid bad luck. It may come from old beliefs that trees have spirits or from the Christian cross made of wood. Different countries have their own ways to “knock on wood” to stay lucky. For example, in Italy, people “touch iron,” and in Turkey, they knock twice and pull their earlobe. 🌳🙏🍀 [Read more] @googlefactss #KnockOnWood#GoodLuck#Superstition#Idioms#Culture