I have a file that I need to grab the content between 2 spots.
Example.
#STARTPOINT
grab this
#ENDPOINT
I can do this just fine by using:
ereg('#STARTPOINT.*#ENDPOINT', $string, $array);
My Problem is, that there are more occurences of #STARTPOINT and #END POINT.
So if I have something like this:
#STARTPOINT
this is the first one
#ENDPOINT
blah blah blha
#STARTPOINT
this is the second one
#ENDPOINT
When I do my regex, it will grab:
this is the first one
#ENDPOINT
blah blah blha
#STARTPOINT
this is the second one
How do I stop it from being 'greedy'? I want it to stop at the first occurence of #ENDPOINT and not the last. Any ideas would be amazing at this point.
Derek