Improved StringMatching Optional conditions.