Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
An #FBI Boston investigation has resulted in charges against 30 individuals for their roles in a global insider trading scheme that netted tens of millions in illicit profits.
The #FBI executed arrests in AL, CA, FL, NJ, and NY today for individuals who are accused of capitalizing on confidential information stolen from leading corporate law firms advising on mergers & acquisitions in Massachusetts and elsewhere.
Two subjects, located in Israel and Russia, are actively being sought.
1:11 PM · May 6, 2026
X LINK
Read more about today's takedown: https://ow.ly/tyCh50YVHRu
Now do CONGRESS...
Excongresista y lobista estadounidense condenado por actuar como agente no registrado de Venezuela en relación con un contrato de 50 millones de dólares.
Un jurado federal en Miami declaró culpable al excongresista estadounidense David Rivera de ejercer presión en secreto en nombre del gobierno venezolano y de lavar millones de dólares vinculados a ese trabajo, en violación de la Ley de Registro de Agentes Extranjeros.
Obtenga más información sobre la investigación realizada por #FBI y nuestros socios encargados de hacer cumplir la ley:
https://www.justice.gov/usao-sdfl/pr/former-us-congressman-and-lobbyist-convicted-acting-unregistered-agents-venezuela
Panic and protests at the #FBI😮
“According to an email from acting Director Brian Driscoll and reviewed by The Gateway Pundit, each field office is required to submit a list of all personnel, current and former, who were involved in January 6th investigations/prosecutions by noon on Tuesday, February 4th.”
Politics, retribution behind FBI purge, agents allege in new lawsuit against Patel, Bondi
Three senior FBI officials who were abruptly fired last month by Kash Patel, the FBI director, are claiming in a new lawsuit against the Trump administration that they were illegally terminated at the direction of the White House for purely political reasons.
The complaint, filed in U.S. District Court in Washington, D.C., Wednesday, alleges Patel told one of the agents that his job as FBI director depended on firing agents involved in past investigations of President Trump.
Patel allegedly said "he had to fire the people his superiors told him to fire, because his ability to keep his own job depended on the removal of the agents who worked on cases involving the President," the lawsuit alleges.
"Patel explained that there was nothing [anyone] could do to stop these or any other firings, because 'the FBI tried to put the President in jail and he hasn't forgotten it,'" the complaint claims. According to the complaint, former FBI agent Brian Driscoll indicated he believed Patel was referring to his superiors at the White House and the Justice Department which "Patel did not deny."
#Trump#FBI
👂More on Trump's Ear ⚠️
🔍🏛️EXCLUSIVE: FBI DIVERTS 25% OF AGENTS TO IMMIGRATION — CHILD CRIMES LEFT UNDERSTAFFED
🔹 Over six thousand FBI agents (quarter of all staff) reassigned to immigration cases in Trump's first 9 months 👮
🔹 Massive 23X increase from previous levels — agents pulled from child exploitation, terrorism, corporate fraud 🚨
🔹 ICE death toll hits 18 in 2026 as Cuban immigrant dies in Georgia detention — suspected suicide 💀
🔹 Federal charges filed against Salvadoran man shot by ICE in California traffic stop gone wrong 🚔
When immigration becomes top priority, who's protecting kids from predators? Priorities matter 🔥⚖️
#Immigration#FBI
@america