Re: how to match a paragraph by regexp?
That's the expected behaviour. In your first code, your are matching with one line at a time. Hence, it returns the line
/* 4 ABC:DEFG=12334556,BSERV=T22; */
which fits all the three matching conditions that you have put.
But in the second code, you are taking one paragraph at a time. So, for the first iteration $data1 will be
/* 3 SESSION=01547 USERID=user 2008-05-13 09:46:12 */
/* 4 ABC:DEFG=12334556,BSERV=T22; */
/* 4c COMMAND EXECUTED */
which doesn't return true for all the 3 match conditions.
Last edited by nithinpes : May 14th, 2008 at 08:55 AM.
Reason: removed initial quote