Регулярные выражения иногда могут быть просто монструозными. Выглядеть это может крайне запутанно. Сами регэкспы и без того история непростая, а когда это длинный паттерн на несколько десятков знаков, разобрать там что-либо становится не просто.
Но на помощь приходит Python и его стремление сделать нашу жизнь проще!
В функциях регулярок можно после паттерна указывать флаги, один из которых позволяет писать паттерны более свободно. А именно, добавлять пробелы и переносы, которые будут игнорированы. В результате мы можем разбить паттерн на строки и добавить комментов.
Чтобы это сработало нужно добавить флаг re.VERBOSE. Пробелы в паттерне теперь следует указывать явно спец символами.
Согласитесь, что даже с именованными группами а таком виде регэкспа выглядит вполне сносно 😉.
#tricks#regex
City of Leaves / Tech city of Healing.
80m tower as a floating roof with green garden underneath.
Sou Fujimoto won the competition to design a tower and cultural facilities in Nanchang, China.
Architecture: Sou Fujimoto
Client: China Jinmao 中国金茂
Location: Nanchang, China
Program: Culture Center, Observatory Tower and Restaurant.
#arch_shovel#architecture#SouFujimoto#architects#award#news#ArchitectureNews
STUDENT RESIDENCE AND RECERSIBLE CAR PARK.
By BRUTHER, BAUKUNST
Location: FRANCE - PLATEAU DE SACLAY
Year: 2020
Photographer: Filip Dujardin , Maxime Delvaux
#architects#design#designer#architecture#archdaily#render#interiors#arch_shovel
Eight-storey wooden building for the Nordhavn waterfront on the eastern edge of Copenhagen.
The landscape design at Marmormolen in Copenhagen revolves around a unified symbiosis of greenery on the rooftops, courtyards, inside and around the office building — which will become one of Denmark's largest timber constructions — to create a living and lush experience for employees, visitors and pedestrians.
Architecture, landscape architecture and interior design: Henning Larsen Architects in collaboration with AP Pension and Ramboll denmark.
Renders by IMIGO (1+2) and Sora (3+4).
#arch_shovel#architecture#henninglarsen#architects#denmark#copenhagen#landscapeDesign