This will take all of the include files it finds in FILE and store them in
the array @headers.

while (<FILE>)
{
        /^#include\s+"([^"]+)"/;
        push @headers, $1;
}

Fridays can definitely be killers! ;)

-----Original Message-----
From: Yvonne Murphy [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 13, 2001 9:46 AM
To: [EMAIL PROTECTED]
Subject: Regex......some help quickly!!!!


Hi All,
It's Friday evening and my brain is already beginning to close down for
the weekend although I haven't yet given it
permission to do so! I need to get this regex problem I have sorted
soon, but my brain refuses to co-operate with me.

I need to match the following type of #include statement found in a C
header file:


#include " test/bar.h "
#include " other/foo.h "

I need to be able to work on the actual header files so I need to be
able to store
the directory pathnames in a varible.
Any idea/help/suggestions would be so gratefully appreciated
Thanks in advance
Mich



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to