in reply to finding data in a string

what if its like this
$string = "stuff, Hello the name of this site is perlmonks.org, goodby +e./n stuff Hello my name is bob, goodbye."
how could i make it so that it gets both strings between Hello and goodbye
@newarray = (" the name of this site is perlmonks.org, ", " my name is + bob, ")
does the /n return make a difference

Replies are listed 'Best First'.
Re: Re: finding data in a string
by I0 (Priest) on Aug 21, 2001 at 03:14 UTC
    @newarray = $string =~ /Hello(.*?)goodbye/g
Re: Re: finding data in a string
by E-Bitch (Pilgrim) on Aug 21, 2001 at 02:37 UTC
    I think I can tame this one... use the split function:

    my @newarray = split (/Hello/$string); 
    


    (man I hope that syntax is right... looked it up though, so it should be fine.)
    _________________________________________
    E-Bitch
    Tempora Mutantur Nos et Mutamur in Illis
    "The Times are Changed Even as We are Changed in Them"