in reply to Extract words from brackets

Hi,

If extraction of contents in inthe inner paranthesis is your only concern, try

$str = "((A AND B) OR (C AND D) NOT E)"; print "$1\n" while( $str =~ /\(([\w\s]+)\)/g);

this may not be the best solution, but this is the first solution I have.

Cheers !

--VC


There are three sides to any argument.....
your side, my side and the right side.

Replies are listed 'Best First'.
Re^2: Extract words from brackets
by Archana (Initiate) on Jul 20, 2007 at 03:20 UTC
    Hi, This works for multiple brackets that is (((A AND B) OR (C AND D) NOT (E AND F)))? with regards Archana