private static string Pack(IEnumerable <string> aexp, PcrOptions options) { if (options.HasFlag(PcrOptions.Special)) { return("(" + String.Join("|", aexp.Select(i => PreCompile(i))) + ")\\b"); } if (options.HasFlag(PcrOptions.Precompiled)) { return("\\b(" + String.Join("|", aexp.Select(i => PreCompile(i))) + ")\\b"); } if (options.HasFlag(PcrOptions.Keywords)) { return("\\b(" + String.Join("|", String.Join("|", aexp)) + ")\\b"); } return(String.Join("|", aexp)); }
public PCR(string name, IEnumerable <string> exp, PcrOptions options, RegexOptions regexOptions = RegexOptions.None) : base(Pack(exp, options), regexOptions, name, NS, true) { }
public PCR(string name, string exp, PcrOptions options, RegexOptions regexOptions = RegexOptions.None) : base(PreCompile(exp), regexOptions, name, NS, true) { }
private static string Pack(IEnumerable<string> aexp, PcrOptions options) { if (options.HasFlag(PcrOptions.Special)) return "(" + String.Join("|", aexp.Select(i => PreCompile(i))) + ")\\b"; if (options.HasFlag(PcrOptions.Precompiled)) return "\\b(" + String.Join("|", aexp.Select(i => PreCompile(i))) + ")\\b"; if (options.HasFlag(PcrOptions.Keywords)) return "\\b(" + String.Join("|", String.Join("|", aexp)) + ")\\b"; return String.Join("|", aexp); }
public PCR(string name, IEnumerable<string> exp, PcrOptions options, RegexOptions regexOptions = RegexOptions.None) : base(Pack(exp, options), regexOptions, name, NS, true) { }