regex - How to get all string matching regex1 followed by a string? -


मेरी एक बड़ी पाठ फ़ाइल है I मैं फॉर्म

  (1, 2, 4, ...)   

के स्ट्रिंग्स को चुनना चाहता हूं, जिसके बाद स्ट्रिंग "फोबोर" । इन दो स्ट्रिंग दोनों को कई लाइनों पर दिखाई दे सकता है यह कैसे जल्दी से UNIX कमांड लाइन पर कर सकता है?

उदाहरण

  (1, 2) फ़ॉबोर फ़ॉबार (3, 4, 5) फोबोड़ (23, 45) (6 , 7, 8) फ़ूबार (9, 10, 11) एफयू बार   

देना चाहिए

  (1, 2) (3, 4, 5) (6, 7, 8) (9, 10, 11)    

  $ Tr-d '\ n' & lt; इनपुट | Grep -oP '\ ([^ ()] * \) (? = Foobar)' (1, 2) (3, 4, 5) (6, 7, 8) (9, 10, 11)    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -