public int GetSwiftDay(string text) { var trimmedText = text.Trim(); var swift = 0; if (NextPrefixRegex.IsMatch(trimmedText)) { swift = 1; } else if (PreviousPrefixRegex.IsMatch(trimmedText)) { swift = -1; } return(swift); }
public int GetSwiftMonthOrYear(string text) { var trimmedText = text.Trim().ToLowerInvariant(); var swift = 0; if (NextPrefixRegex.IsMatch(trimmedText)) { swift = 1; } else if (PreviousPrefixRegex.IsMatch(trimmedText)) { swift = -1; } return(swift); }
public int GetSwiftMonthOrYear(string text) { var trimmedText = text.Trim().Normalized(DateTimeDefinitions.SpecialCharactersEquivalent); var swift = 0; if (NextPrefixRegex.IsMatch(trimmedText)) { swift = 1; } if (PreviousPrefixRegex.IsMatch(trimmedText)) { swift = -1; } return(swift); }
public int GetSwiftMonth(string text) { var trimmedText = text.Trim().ToLowerInvariant().Normalized(); var swift = 0; if (NextPrefixRegex.IsMatch(trimmedText)) { swift = 1; } if (PastPrefixRegex.IsMatch(trimmedText)) { swift = -1; } return(swift); }
public override int GetSwiftYear(string text) { var trimmedText = text.Trim(); var swift = -10; if (NextPrefixRegex.IsMatch(trimmedText)) { swift = 1; } else if (PreviousPrefixRegex.IsMatch(trimmedText)) { swift = -1; } else if (ThisPrefixRegex.IsMatch(trimmedText)) { swift = 0; } return(swift); }
public int GetSwiftMonthOrYear(string text) { var trimmedText = text.Trim(); var swift = 0; var afterNextMatch = AfterNextPrefixRegex.Match(text); if (afterNextMatch.Success) { swift = 2; } else if (NextPrefixRegex.IsMatch(trimmedText)) { swift = 1; } else if (PreviousPrefixRegex.IsMatch(trimmedText)) { swift = -1; } return(swift); }