properly matching  and , instead of replacing variables