Регулярные выражения иногда могут быть просто монструозными. Выглядеть это может крайне запутанно. Сами регэкспы и без того история непростая, а когда это длинный паттерн на несколько десятков знаков, разобрать там что-либо становится не просто.
Но на помощь приходит Python и его стремление сделать нашу жизнь проще!
В функциях регулярок можно после паттерна указывать флаги, один из которых позволяет писать паттерны более свободно. А именно, добавлять пробелы и переносы, которые будут игнорированы. В результате мы можем разбить паттерн на строки и добавить комментов.
Чтобы это сработало нужно добавить флаг re.VERBOSE. Пробелы в паттерне теперь следует указывать явно спец символами.
Согласитесь, что даже с именованными группами а таком виде регэкспа выглядит вполне сносно 😉.
#tricks#regex
DRDO Chief Dr. Samir V Kamat has inaugurated a Compo-Rheo Die Casting (CRDC) facility at IISc-Bengaluru Campus for producing high-performance alloys.
CRDC is an advanced hybrid metallurgical process that combines elements of Composite material fabrication & Rheocasting to produce high-performance metal matrix composites.
#aatmarnirbharbharat
Mishra Dhatu Nigam Limited (MIDHANI) has inaugurated a state-of-the-art Aerospace Fasteners Facility in Hyderabad, marking its transition into a fully integrated manufacturer of high-precision components for extreme environments, including titanium and superalloy fasteners. By maintaining 100% in-house production and hosting resident inspection agencies, the facility ensures stringent quality control and compliance for the defense and aerospace sectors.
Source
#aatmarnirbharbharat#defence
DRDO Chairman Dr Samir V Kamat said the Ghatak UCAV will be comparable to a stealth fighter in capability. "They will be like fighters, they would be a stealth fighter... about a 13-ton class... LCA type fighter aircraft," Kamat said, adding that a recent proposal cleared by the Defence Procurement Board envisages induction of around 67 such systems. #Defence#aatmarnirbharbharat
BDL achieved a major milestone in indigenous defence manufacturing with the delivery of India’s first Production-Grade Wire Guided Heavy Weight Torpedo to NSTL at Visakhapatnam. #Defence#aatmarnirbharbharat
Vadodara-based INOX India has flagged-off the 'simulated Liquid Oxygen (LOX) Storage Module' to DRDO (NMRL) for India’s first indigenous AIP System. #Defence#aatmarnirbharbharat
Hyderabad-based ZenT echnologies has received a licence to manufacture 12.7mm, 23mm, 30mm & 40mm air defence guns to defend from low flying targets. #Defence#aatmarnirbharbharat
HAL has inaugurated a LCH Prachand (156 on order) Structure Assembly Line and an Automated Storage & Retrieval System (ASRS) at Tumakuru (Karnataka) today. #Defence#aatmarnirbharbharat
Union Cabinet approves Bharat Maritime Insurance pool (BMI pool) with a sovereign guarantee of Rs 12,980 crore to facilitate continuous maritime insurance coverages: I&B Minister Ashvini Vaishnav
This will reduce dependence on foreign insurance providers for maritime transport #Policy#aatmarnirbharbharat
Atomberg Tech introduces 1st Generation Drone Propulsion Systems.
An excellent step towards becoming 'Atmanirbhar' in #drones. Presently most of these propulsion systems are imported. #aatmarnirbharbharat
Delhi-based dpropulse is building India's first rotating detonation engine (RDE).
#Aviation#aatmarnirbharbharat
https://fxtwitter.com/i/status/2044030717123014797