using System.Text.RegularExpressions; namespace Core.Parsers.EventOccurrence; /// /// Parses time and location from combined strings. /// Extracts time using regex, then uses everything after the time as the location. /// public static class TimeLocationParser { // Shared time value pattern: matches either NOON or a time with AM/PM (e.g., "10:30 a.m.", "3 p.m.") private static string TimeValuePattern => TimePatterns.TimeValue; // Regex to match time ranges like "10:30 a.m. - 12:00 p.m." or "10:30 a.m. - NOON" // Matches: time1 (optional dash time2/NOON), then location // The time group captures the full time range (including " - NOON" if present) // Note: Input is normalized via SanitizeInput, so only regular hyphens need to be handled private static readonly Regex TimeLocationRegex = new( $@"(?