public static string GenPattern(Model.Data.Enum.LinkTypes linkType) { return(string.Format( "{0}{1}{2}", StrConst("PatternNonAlphabet"), // vme[ss] GetLinkPrefix(linkType), StrConst("PatternBase64"))); }
public static List <string> ExtractLinks(string text, Model.Data.Enum.LinkTypes linkType) { string pattern = GenPattern(linkType); var matches = Regex.Matches("\n" + text, pattern, RegexOptions.IgnoreCase); var links = new List <string>(); foreach (Match match in matches) { links.Add(match.Value.Substring(1)); } return(links); }
public static string AddLinkPrefix(string b64Content, Model.Data.Enum.LinkTypes linkType) { return(GetLinkPrefix(linkType) + b64Content); }
static string GetLinkPrefix(Model.Data.Enum.LinkTypes linkType) { return(Model.Data.Table.linkPrefix[(int)linkType]); }