For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > January 2006 > Patter matching how to









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Patter matching how to
stunner

2006-01-24, 9:21 pm

I have text something like

========================================
=

details:
ID=1234
val=ABCD
sum=f5303

value1:
ID=7589
sum=435


=======================================

The above text is in a file.....

Now I need to parse only the details secion..

Input will be details (name) and ID from command line arguments...

Now the output should be ID=1234...

My problem is : How do I extract only this part

ID=1234
val=ABCD
sum=f5303

I am not able to write a regular expression to match this, i.e it is not going to multiple line

Please Help
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com