in reply to Re^2: regex question
in thread regex question

In that case, you can use m//g in list context:
my $s = 'abc*def*ghi'; my @words = ($s =~ /([^*]+)/g);

Replies are listed 'Best First'.
Re^4: regex question
by JadeNB (Chaplain) on Sep 01, 2008 at 17:59 UTC
    my @words = ($s =~ /([^*]+)/g);
    Note that this code skips empty fields (leading, trailing, or internal)—for example, @words becomes ('a', 'b') if $s is a**b. Of course, this may be the desired behaviour.