in reply to Re^2: refine regexin thread refine regex
Don't need the trailing ' ?'. $string =~ s! ?NOT (?:".*?"\[MESH\]|\(.*?\))!!g; works fine.