Mike Lewis
Programmer
I am using a regular expression to return a substring .... something like this:
(The bold text in the above code is just so that you can easily see the items I want to find.)
The above code correctly returns the first of the fruit. My question is: How do I retrieve the subsequent occurrences? Is there an easy way to do that using regexps?
Thanks in advance.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro tips, advice, training, consultancy
Custom software for your business
Code:
$source = ' blah blah blah [b]Fruit=Apple;[/b] blah
blah [b]Fruit=Orange;[/b] blah blah [b]Fruit=Tangerine[/b]; blah ';
$pattern = 'Fruit=[A-Za-z]*;';
eregi($pattern, $source, $fruit);
echo $fruit[0];
(The bold text in the above code is just so that you can easily see the items I want to find.)
The above code correctly returns the first of the fruit. My question is: How do I retrieve the subsequent occurrences? Is there an easy way to do that using regexps?
Thanks in advance.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro tips, advice, training, consultancy
Custom software for your business