in reply to Re:regular expression by funky monk
in thread Regular expreesion for extraction of words

hi,

I want in separate arrays.

o/p:-(1st array)
(control OR regulat) (blood AND marrow)
(2nd array)
(transcription AND factor) (TATA OR TBP)
$_ = '((transcription AND factor)NOT(control OR regulat) AND (TATA OR +TBP) NOT (BLOOD AND marrow))'; my @caps = m/NOT # "NOT" \s* # spaces? ( # start capturing \( # "(" [^)]+ # some not ")"s \) # ")" ) # end capture /xg; print join "\n", @caps;