extract regexp as variable