
jaquemon
New User
May 23, 2007, 9:59 AM
Post #1 of 5
(1742 views)
|
|
Complex regex help? Look if you dare!
|
Can't Post
|
|
Below is what I have so far and this is what I am looking for. I have tried a multitude of combinations of regex's, all to no avail for what I am trying to do. I am trying to pull out a paragraph of information based on the following conditions: 1. The user specified pattern, $agent, will appear at the top of the first paragraph. If this is going to be a valid match, $agent must also appear at the end of the second paragraph. 2. The problem I am having is differentiating between the two. By this I mean some paragraphs will have the $agent in the beginning and at the end. The only difference between a valid match and junk is there is a blank line between the two. I have attempted to use ^$ (blank line) which works for a blank line by its self, but whenever I try to use it concatenated with anything else, it fails the test. Any help is greatly appreciated and if anyone has any ?'s feel free to ask. I hope this is easy for someone else. Thanks
while (<IN>) { # where $agent is a pattern user speciefies if ( /[0-9].$agent\.waw/../\d\.\d(^$)(.*)type \- $agent\- \?{2} false/) { print OUT $_; } }
|