I want to extract lines following some sequence from a file. E.g. a file contains many lines and I want line in sequence
journey (a,b) from station south chennai to station punjab chandigarh
journey (c,d) from station jammu katra to city punjab chandigarh
journey (e) from station
let's say above is the code and I want to extract the following information from the first first two lines:
e.g this is the sequence first word is journey---
then brackets will contain two words, ----
then word from ---
and then it could be word station or city ---
and then again any string ---
then again word to ---
and then it could be word station or city---
What would be the regular expression for that?
Note: Words in brackets may contain special characters e.g -,_
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…