/// <summary> /// Initializes a new instance of the <see cref = "RegExp" /> class from a string. /// </summary> /// <param name = "s">A string with the regular expression.</param> /// <param name = "syntaxFlags">Boolean 'or' of optional syntax constructs to be enabled.</param> public RegExp(string s, RegExpSyntaxOptions syntaxFlags) { this.b = s; this.flags = syntaxFlags; RegExp e; if (s.Length == 0) { e = RegExp.MakeString(string.Empty); } else { e = this.ParseUnionExp(); if (this.pos < b.Length) { throw new ArgumentException("end-of-string expected at position " + this.pos); } } this.kind = e.kind; this.exp1 = e.exp1; this.exp2 = e.exp2; this.s = e.s; this.c = e.c; this.min = e.min; this.max = e.max; this.digits = e.digits; this.from = e.from; this.to = e.to; this.b = null; }
/// <summary> /// Initializes a new instance of the <see cref = "RegExp" /> class from a string. /// </summary> /// <param name = "s">A string with the regular expression.</param> /// <param name = "syntaxFlags">Boolean 'or' of optional syntax constructs to be enabled.</param> internal RegExp(string s, RegExpSyntaxOptions syntaxFlags) { this.b = RegExp.ReplaceShorthandCharacterClasses(s); this.flags = syntaxFlags; RegExp e; if (s.Length == 0) { e = RegExp.MakeString(string.Empty); } else { e = this.ParseUnionExp(); if (this.pos < this.b.Length) { throw new ArgumentException("end-of-string expected at position " + this.pos); } } this.kind = e.kind; this.exp1 = e.exp1; this.exp2 = e.exp2; this.s = e.s; this.c = e.c; this.min = e.min; this.max = e.max; this.digits = e.digits; this.from = e.from; this.to = e.to; this.b = null; }
/// <summary> /// Initializes a new instance of the <see cref = "RegExp" /> class from a string. /// </summary> /// <param name = "s">A string with the regular expression.</param> /// <param name = "anyCharAlphabet">A string with the regular expression.</param> /// <param name = "syntaxFlags">Boolean 'or' of optional syntax constructs to be enabled.</param> public RegExp(string s, string anyCharAlphabet, RegExpSyntaxOptions syntaxFlags) { this.b = s; this.flags = syntaxFlags; RegExp e; if (anyCharAlphabet != null) { this.anyCharAlphabet = anyCharAlphabet; } if (s.Length == 0) { e = RegExp.MakeString(string.Empty); } else { e = this.ParseUnionExp(); if (this.pos < b.Length) { throw new ArgumentException("end-of-string expected at position " + this.pos); } } this.kind = e.kind; this.exp1 = e.exp1; this.exp2 = e.exp2; this.s = e.s; this.c = e.c; this.min = e.min; this.max = e.max; this.digits = e.digits; this.from = e.from; this.to = e.to; this.b = null; }
/// <summary> /// Initializes a new instance of the <see cref = "RegExp" /> class from a string. /// </summary> /// <param name = "s">A string with the regular expression.</param> /// <param name = "syntaxFlags">Boolean 'or' of optional syntax constructs to be enabled.</param> public RegExp(string s, RegExpSyntaxOptions syntaxFlags) { this.b = s; this.flags = syntaxFlags; RegExp e; if (s.Length == 0) { e = RegExp.MakeString(string.Empty); } else { e = this.ParseUnionExp(); if (this.pos < b.Length) { throw new ArgumentException("end-of-string expected at position " + this.pos); } } this.Kind = e.Kind; this.Expr1 = e.Expr1; this.Expr2 = e.Expr2; this.SourceRegExpr = e.SourceRegExpr; this.Char = e.Char; this.Min = e.Min; this.Max = e.Max; this.Digits = e.Digits; this.FromChar = e.FromChar; this.ToChar = e.ToChar; this.b = null; }
public RegExp(string s, RegExpSyntaxOptions syntaxFlags) { _B = s; _Flags = syntaxFlags; RegExp e; if (s.Length == 0) { e = MakeString(string.Empty); } else { e = ParseUnionExp(); if (_Pos < _B.Length) { throw new ArgumentException("end-of-string expected at position " + _Pos); } } _Kind = e._Kind; _Exp1 = e._Exp1; _Exp2 = e._Exp2; _S = e._S; _C = e._C; _Min = e._Min; _Max = e._Max; _Digits = e._Digits; _From = e._From; _To = e._To; _B = null; }
private bool Check(RegExpSyntaxOptions flag) { return (flags & flag) != 0; }
private bool Check(RegExpSyntaxOptions flag) { return((this.flags & flag) != 0); }
private bool Check(RegExpSyntaxOptions flag) => (_Flags & flag) != 0;