srivats has asked for the wisdom of the Perl Monks concerning the following question:
I tried even stripping new lines just before checking for$Fil = "test.txt" open Fil or die "cannot open file" while(<Fil>) { if($_=~m/name_of_the_struct/ .. $_=~m/};/) { if($_=~m/[ ]*{[ -,"\nA-Za-z0-9]*}/ { do_some_oper; } } } Example struct struct name_of_the_struct[]= { { 1, "abc", 234 , <new line> 567,90 }, {2,"asd",333,455,677} };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex does not work across new line character
by halley (Prior) on Mar 19, 2004 at 17:39 UTC | |
|
Re: Regex does not work across new line character
by tinita (Parson) on Mar 19, 2004 at 17:43 UTC | |
|
Re: Regex does not work across new line character
by TomDLux (Vicar) on Mar 20, 2004 at 15:23 UTC | |
by srivats (Initiate) on Mar 20, 2004 at 15:58 UTC |