in reply to capturing words

Try:
while (<INPUT>) { if (/^AMQ8409 .* QUEUE\( ([^\)]+) \) .* RNAME\( ([^\)]+) \)/x) { print OUTPUT "QUEUE($1) ------> RNAME($2)\n"; } }

Replies are listed 'Best First'.
Re^2: capturing words
by johngg (Canon) on Nov 08, 2007 at 16:17 UTC
    Why not save a little typing and put the captures around the whole "QUEUE(...)" and "RNAME(...)"?

    while ( <INPUT> ) { print OUTPUT qq{$1 ------> $2\n} if m{(?x) ^ AMQ8409 .*? ( QUEUE .*? \) ) .* ( RNAME .*? \) ) }; }

    You don't need to escape the closing parenthesis in your negated character class, BTW.

    Cheers,

    JohnGG