I am rather new to regex and am stuck on the following where I try to use preg_match_all to count the number of hello after world.
If I use "world".+(hello), it counts to the in the last hello; "world".*?(hello) stops in the first hello, both giving one count.
blah blah blah
hello
blah blah blah
class="world"
blah blah blah
hello
blah blah
hello
blah blah blah
hello
blah blah blah
I am expecting 3 as the count because the hello before world should not be counted.