Регулярные выражения иногда могут быть просто монструозными. Выглядеть это может крайне запутанно. Сами регэкспы и без того история непростая, а когда это длинный паттерн на несколько десятков знаков, разобрать там что-либо становится не просто.
Но на помощь приходит Python и его стремление сделать нашу жизнь проще!
В функциях регулярок можно после паттерна указывать флаги, один из которых позволяет писать паттерны более свободно. А именно, добавлять пробелы и переносы, которые будут игнорированы. В результате мы можем разбить паттерн на строки и добавить комментов.
Чтобы это сработало нужно добавить флаг re.VERBOSE. Пробелы в паттерне теперь следует указывать явно спец символами.
Согласитесь, что даже с именованными группами а таком виде регэкспа выглядит вполне сносно 😉.
#tricks#regex
New day, new chapter, new hotel, new emotions, new memories ..🤍🐚🧜🏻♀️
Our Mermaid adventure continue with @velassarumaldives💙
The Best Beach I’ve ever been to!
#оченьрекомендую#pureshores#velassarumaldives#velassaru#maldives#vacation#travelling#каникулы#miracle#indianocean#worldwide#mermaidlife#mira#thankyou #🙏🏻 #🤍#harmony#balance #🧘🏼♀️
One more day with @velassarumaldives ..💙
One more day with Mother Nature .. 🧜🏻♀️
Total balance with my Inner and Outer Amazon .. @rodasoleil✨
..Такими зелеными бывают деревья в ярких живописных снах. Таким синим был бы океан, если бы он мог достичь совершенства.. здесь сны видятся также ясно, как будущее в блюде мексиканских женщин, предсказывающих будущее у ночного костра… всем baajjaa veri hendhuneh ☀️
#velassarumaldives#velassaru
#maldives#vacation#miracle#honeymoon#withmylilsis#thankyou #🙏🏻#moodoftheday#paradise#hooponopono #🧘🏼♀️#balance#privacy#harmony#traveltheworld#greengo#purenature#amazon#myroots#mira#petitefemme
I’m back!❤️🔥
Luxury undressed by @velassarumaldives🧜🏻♀️🫶🏻
The local beach,lagoon,coral reefs and marine flora and fauna have an extraordinary beauty that cannot be expressed in words.This is one of the most amazing places you would like to visit in your life.It is the epitome of beauty with white sand and clear water.This is Mother Nature’s best masterpiece,every day she mixes all the colors of the sky and the ocean,and you can’t figure out whether the sky is eating the ocean or the ocean is eating the sky.Watching,enjoying,filling up..
#velassarumaldives#nextstop#resort#luxury#maldives#maldivesislands#vacation#vacances#sun#summer #2024 #photooftheday#moodoftheday#beachlife#sunvibes#positivevibes#purelove#heavenonearth#mira#actress#mothernature#planetearth#velassaru#magic#miracle#haveaniceday#доброеутро#отпуск#всемотличногонастроения#лето