[PHP] Need help with ereg regular expression

2005-02-02 Thread KHS
Hi, I'm trying to extract a string using 'ereg()' but it doesn't seem to find some strings. I am using php version 4.3.10 in cli mode. Here is an example of the input: #include FT_FREETYPE_H #include stdio.h #include freetype/freetype.h Here is a snip of my code: $line = fgets($fp); $line =

Re: [PHP] Need help with ereg regular expression

2005-02-02 Thread KHS
Richard Lynch wrote: KHS wrote: Here is an example of the input: #include FT_FREETYPE_H #include stdio.h #include freetype/freetype.h Here is a snip of my code: $line = fgets($fp); $line = trim($line); $regexp = '^#include(:? | | )([^ ]+)[ ]'; //$regexp = '^#include( | | )[^ ]+[ ]'; //Same