Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в Python в модуле re.
Чтобы указать флаг для компилятора нам надо указать его после передаваемой строки. Например, добавляем флаг для игнорирования переноса строки.
pattern = re.compile(r"(\w+)+")
words = pattern.search(text, re.DOTALL)
А как указать несколько флагов? Ведь явно будут ситуации когда нам потребуется больше одного. Кто читал посты по битовые операторы уже понял как.
pattern.search(text, re.DOTALL | re.VERBOSE)
А теперь смотрим исходники, что находится в этих атрибутах?
Не удивительно, степени двойки. Почему? Потому что каждое следующее значение это сдвиг единицы влево.
>>> for n in [1, 2, 4, 8, 16, 32, 64, 128, 256]:
>>>
print(bin(n))
0b1
0b10
0b100
0b1000
0b10000
0b100000
0b1000000
0b10000000
0b100000000
Чтобы было понятней, давайте напишем тоже самое но иначе, добавим ведущие нули:
000000001
000000010
000000100
000001000
000010000
000100000
001000000
010000000
100000000
Не понятно что тут происходит? Читай три поста про битовые операторы начиная с этого ➡️https://t.me/pythonotes/45
В общем, это пример применения побитовых операций в самом Python.
Теперь вы знаете Python еще немного лучше)
#tricks#regex#libs
💥BREAKING! Weapons meant for Ukraine USED in the devastating terrorist attack in Israel! The Biden Administration's SHOCKING REPEATED REFUSAL on arms tracking, paired with Ukraine's notorious black market, fuels a terrifying new threat for the world. We will see MUCH MORE of this, coming soon through the Southern Border near you! ⚠️🔥#UkraineArmsScandal#MiddleEastCrisis
Listen as Sayed Mohammad Maranda discusses the critical situation unfolding in Gaza and the looming threat of escalation with Iran. The stakes are higher than ever.
#MiddleEastCrisis#Iran#USA#Israel#Netanyahu#Hezbollah#War
🔺Continuation from above
@rednile12
📌 What Happened Earlier Today
Earlier on February 28, 2026, the United States and Israel launched a coordinated military offensive against multiple targets in Iran — an operation involving aerial and missile strikes planned over weeks, according to Israeli officials.
Western powers claimed the operation aimed to neutralize what they described as “existential threats” posed by Iran’s missile and nuclear programs. However, Russia and others have condemned the U.S.–Israel assault as a premeditated, unprovoked act of aggression against a sovereign state.
🔥 Iran’s Retaliatory Tactics
Iran’s response appears to reflect a strategic approach, not a spontaneous counterattack:
🔹Missile Barrages First:
Iran fired ballistic missiles at multiple targets hosting U.S. forces and allied positions across the Gulf — including Qatar, Bahrain, Kuwait, and the UAE.
🔹Drone Saturation:
Following the missile salvos, waves of Shahed-136 drones were reportedly used to strike high-value U.S. radar and defense infrastructure once expensive interceptor systems were already engaged.
🔹 This layered method has key implications:
▪️ It forces U.S. and allied defenses to expend high-cost interceptors against cheaper threats.
▪️ It exploits cost asymmetry, where low-cost drones can wear down advanced systems economically and tactically over time.
▪️ It demonstrates Iran’s ability to integrate UAVs into broader retaliation campaigns, not just standalone strikes.
🧠 Strategic Takeaways
📍Damage to Early Warning Capabilities
If U.S. AN/FPS-132 radars are seriously degraded or destroyed, it would reduce the effectiveness of missile tracking and early warning across the region, complicating air defense coordination in a rapidly evolving war environment.
📍Cost Imbalance in Modern Air Defense
Iran’s combination of missiles and inexpensive drones highlights a structural weakness in defense architectures built around costly interceptor munitions.
📍Regional Escalation Risks
Today’s retaliation underscores how quickly localized strikes can escalate into broader conflict — dragging multiple Gulf states into direct confrontation, disrupting airspace, and threatening civilian infrastructure across the region.
♦️This is no ordinary exchange of fire — it reflects a turning point in regional warfare dynamics, where retaliation, sequencing, cost imbalances, and strategic targeting have dramatic implications for how future conflicts unfold.
RedNile Media🌊🧭
📡@rednile12
Geopolitics | Multipolarity | Sovereignty | Strategic Reality
#Iran#USA#Israel#MiddleEastCrisis#GulfSecurity
🚨 BREAKING NEWS 🚨
"Al-Quds Brigade, part of the Islamic Jihad group, claims to have captured Israeli soldiers during an operation near Gaza. Hamas reports seizing 14 tanks and IDF prisoners. Israel declares a state of war, launching 'Operation Iron Swords'. Tensions escalate."
💣💥#MiddleEastCrisis#PrisonersOfWar#IsraelVsHamas
https://www.gazeta.ru/army/news/2023/10/07/21450403.shtml
Subscribe to @BadVolfNews