match pattern of multiple lines
From: John Black (black_at_eed.com)
Date: 07/16/04
- Next message: Gunnar Hjalmarsson: "Re: match pattern of multiple lines"
- Previous message: Mohammd M. Hussain: "Re: return hash"
- Next in thread: Gunnar Hjalmarsson: "Re: match pattern of multiple lines"
- Reply: Gunnar Hjalmarsson: "Re: match pattern of multiple lines"
- Reply: Mohammad Mahmoud Khajah: "Re: match pattern of multiple lines"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 15 Jul 2004 16:26:28 -0600
Hi,
I need to match the following pattern with a file,
begin <some string>
<some thing this line>
<some thing this line>
......
end
I check the web, it says I should use pattern modifier s & m, so I
write it this way,
while (<MyFile>){
if (/^(\s*)begin(.*)^(\s*)end/smi){
... call my function...
}
}
But it never matches the pattern, do you see the problem?
Thanks!
- Next message: Gunnar Hjalmarsson: "Re: match pattern of multiple lines"
- Previous message: Mohammd M. Hussain: "Re: return hash"
- Next in thread: Gunnar Hjalmarsson: "Re: match pattern of multiple lines"
- Reply: Gunnar Hjalmarsson: "Re: match pattern of multiple lines"
- Reply: Mohammad Mahmoud Khajah: "Re: match pattern of multiple lines"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]