in reply to Regex substitution

Once you "catch" them, what do you want to do with them?

Taking one wild guess, which could be totally off, because I can think of about three or four things you might mean, let's say you want to grab all the items that are comma-delimited inside the parens:

$string = "blah blah (name 1, name 2, name 3 and name 4), blah blah (n +ame 1, name 2, name 3 and name 4)"; @items = map { split /,\*/ } $string =~ /\((.*?)\)/g;

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
RE: Re: Regex substitution
by swiftone (Curate) on Sep 11, 2000 at 08:26 UTC
    @items = map { split /,\*/ } $string =~ /\((.*?)\)/g;

    Tsk. And after Ovid and you went through the rounds in Death to Dot Star!

    (although I don't know which is actually faster)