|
Posted by FFMG on 08/23/06 06:28
Hi,
If I have a string:
$s = "sometext more_text hello1hello2";
And I want to look for the text 'hello', I do the following regex
search
/hello([0-9]*)/is
And I get the expected value of '1', (the first hello)
But if I do
/.*hello([0-9]*)/is
I get the next 'hello', ('2').
But, because I want find the first 'hello' _after_ 'sometext', I want,
(need?), to do
/sometext.*hello([0-9]*)/is
But that returns the second 'hello' not the first one.
What could I be doing wrong?
Thanks
FFMG
Navigation:
[Reply to this message]
|