Ранее я делал серию постов про битовые операторы.
Вот вам ещё один наглядный пример как это используется в 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
El Tottenham perdió 2-0 contra el Manchester City, y con ese resultado el Aston Villa volvió a la champions después de 41 años
Increíble temporada de los villanos🦁
@Fut_planet⚜️#UCL🇪🇺
#AstonVilla🏴
⚽️🇪🇺Champions
Aston Villa 1-0 Bayern#Champions#AstonVilla#Bayern
El regreso de la Copa de Europa a Villa Park -cuatro décadas después- no pudo ser más emotivo. Ni el príncipe Guillermo, 'villano' reconocido', se lo quiso perder. El Aston Villa de Unai Emery recibía al Bayern, el equipo frente al que ganó su primera y única 'orejona' en 1982. Los tres puntos se quedaban en Villa Park. Los 'villanos' son los 'héroes'.
https://www.marca.com/futbol/champions-league/cronica/2024/10/02/66fda028268e3e48788b45a0.html
Otros marcadores
Shakhtar 0-3 Atalanta
D. Zagreb 2-2 Mónaco
Liverpool 2-0 Bolonia
Leipzig 2-3 Juventus
Sturm Graz 0-1 Brujas
🏆@Info288_deportes
⚽️🇪🇺Champions
Aston Villa 0-0 Juventus#Champions#AstonVilla#Juventus
Entre 2016 y 2018, Emery y Motta tuvieron tiempo para conocerse como entrenador y jugador en el PSG y anoche, en su primer duelo en los banquillos al frente de dos campeones de Europa como Aston Villa y una Juventus en cuadro, se anularon mutuamente con un empate (0-0) que deja a ambos fuera del TOP-8. Ambos equipos tuvieron sus opciones... y la 'Vecchia Signora' se salvó en el descuento tras el gol anulado a Rogers.
https://www.marca.com/futbol/champions-league/cronica/2024/11/27/6747696cca4741b56f8b4574.html
Otros marcadores
Estrella Roja 5-1 Stuttgart
Bolonia 1-2 Lille
Celtic 1-1 Brujas
D. Zagreb 0-3 Dortmund
Monaco 2-3 Benfica
PSV 3-2 Shakhtar
🏆@Info288_deportes
England Premier League🏴
2026-05-15 19:00 UTC
Aston Villa vs. Liverpool
Predicted outcome: Liverpool
Predicted score: 2:3
Current: 0:0 23'
#AstonVilla#Liverpool#Live
#Football#PremierLeague
UEFA Europa League🌍
2026-05-07 19:00 UTC
Aston Villa vs. Nottingham Forest
Predicted outcome: Aston Villa✅
Predicted score: 2:1
Actual: Aston Villa 4:0
#AstonVilla#NottinghamForest
2026-05-07 19:00 UTC
SC Freiburg vs. SC Braga
Predicted outcome: SC Freiburg✅
Predicted score: 2:1
Actual: SC Freiburg 3:1
#Freiburg#Braga
#Football#EuropaLeague
UEFA Europa League🌍
2026-04-30 19:00 UTC
Nottingham Forest vs. Aston Villa
Predicted outcome: Aston Villa❌
Predicted score: 1:2
Actual: Nottingham Forest 1:0
#NottinghamForest#AstonVilla
2026-04-30 19:00 UTC
SC Braga vs. SC Freiburg
Predicted outcome: Draw❌
Predicted score: 1:1
Actual: SC Braga 2:1
#Braga#Freiburg
#Football#EuropaLeague
UEFA Europa League🌍
2026-04-09 19:00 UTC
SC Freiburg vs. Celta Vigo
Predicted outcome: Draw❌
Predicted score: 1:1
Actual: SC Freiburg 3:0
#Freiburg#CeltaVigo
2026-04-09 19:00 UTC
FC Porto vs. Nottingham Forest
Predicted outcome: Draw✅
Predicted score: 1:1
Actual: Draw 1:1
#Porto#NottinghamForest
🔥 PREMIUM PICK 🔥
2026-04-09 19:00 UTC
Bologna vs. Aston Villa
Predicted outcome: Draw❌
Predicted score: 1:1
Actual: Aston Villa 1:3
#Bologna#AstonVilla
#Football#EuropaLeague
England Premier League🏴
2026-05-03 13:00 UTC
Bournemouth vs. Crystal Palace
Predicted outcome: Bournemouth✅
Predicted score: 2:1
Actual: Bournemouth 3:0
#Bournemouth#CrystalPalace
2026-05-03 14:30 UTC
Manchester United vs. Liverpool
Predicted outcome: Manchester United✅
Predicted score: 2:1
Actual: Manchester United 3:2
#ManchesterUnited#Liverpool
2026-05-03 18:00 UTC
Aston Villa vs. Tottenham
Predicted outcome: Aston Villa❌
Predicted score: 2:1
Actual: Tottenham 1:2
#AstonVilla#Tottenham
#Football#PremierLeague
England Premier League🏴
2026-03-22 12:00 UTC
Newcastle vs. Sunderland
Predicted outcome: Newcastle❌
Predicted score: 2:1
Actual: Sunderland 1:2
#Newcastle#Sunderland
2026-03-22 14:15 UTC
Tottenham vs. Nottingham Forest
Predicted outcome: Draw❌
Predicted score: 2:2
Actual: Nottingham Forest 0:3
#Tottenham#NottinghamForest
2026-03-22 14:15 UTC
Aston Villa vs. West Ham
Predicted outcome: Aston Villa✅
Predicted score: 2:1
Actual: Aston Villa 2:0
#AstonVilla#WestHam
#Football#PremierLeague
UEFA Europa League🌍
2026-04-16 16:45 UTC
Celta Vigo vs. SC Freiburg
Predicted outcome: Draw❌
Predicted score: 1:1
Actual: SC Freiburg 1:3
#CeltaVigo#Freiburg
2026-04-16 19:00 UTC
Nottingham Forest vs. FC Porto
Predicted outcome: Draw❌
Predicted score: 1:1
Actual: Nottingham Forest 1:0
#NottinghamForest#Porto
2026-04-16 19:00 UTC
Aston Villa vs. Bologna
Predicted outcome: Aston Villa✅
Predicted score: 2:1
Actual: Aston Villa 4:0
#AstonVilla#Bologna
2026-04-16 19:00 UTC
Real Betis vs. SC Braga
Predicted outcome: Real Betis❌
Predicted score: 2:0
Actual: SC Braga 2:4
#RealBetis#Braga
#Football#EuropaLeague
England Premier League🏴
2026-05-10 13:00 UTC
Burnley vs. Aston Villa
Predicted outcome: Aston Villa❌
Predicted score: 1:2
Actual: Draw 2:2
#Burnley#AstonVilla
2026-05-10 13:00 UTC
Crystal Palace vs. Everton
Predicted outcome: Everton❌
Predicted score: 1:2
Actual: Draw 2:2
#CrystalPalace#Everton
2026-05-10 13:00 UTC
Nottingham Forest vs. Newcastle
Predicted outcome: Nottingham Forest❌
Predicted score: 2:1
Actual: Draw 1:1
#NottinghamForest#Newcastle
2026-05-10 15:30 UTC
West Ham vs. Arsenal
Predicted outcome: Arsenal✅
Predicted score: 1:2
Actual: Arsenal 0:1
#WestHam#Arsenal
#Football#PremierLeague