regex to match a multi line pattern 
Author Message
 regex to match a multi line pattern

all,
   I am trying to match a pattern that has multiple lines. I have
found some success, but have hit the wall...

I need a regex that will match:
21 NOV 02  03:17:57PM
*** Today I found God
00000   24C00000 84000000 00003975 9A970100   *$.........9u....*^M
00010   90160000 30010100 03000558 003FFFFF   *....0......X.?..*^M

but not:
21 NOV 02  03:17:57PM
*** Today I found blah-foo
00000   24C00000 84000000 00003975 9A970100   *$.........9u....*^M
00010   90160000 30010100 03000558 003FFFFF   *....0......X.?..*^M

I have been trying:
while(<FILE>){
        print if /^\d{2}\s{1}\D{3}/ .. /^00010.*/;  
             #PerlFAQ..
            }

But can't seem to get any further.
Thanks in advance for feedback,
Jim



Wed, 11 May 2005 07:03:09 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. regex to match a multi line pattern

2. Pattern bug matching whitespace in multi-line match?

3. single line regex and multi-line regex without resetting $/

4. Multi-line pattern matching?

5. Multi line pattern matches?

6. Can't Match Multi-Line Pattern

7. Multi line pattern match

8. Multi-line pattern matching

9. pattern matching in multi-line strings fails under perl4.034

10. Multi-line pattern matching in 5.001n

11. Multi-line regex w/ multi-file loop

12. Multi-Inclusive Pattern Match

 

 
Powered by phpBB® Forum Software