Functional version, stopping VM excluding the pattern specified.