public override CharGroup Negate() { switch (_value) { case CharClass.Digit: return(CharGroup.Create(CharClass.NotDigit)); case CharClass.WordChar: return(CharGroup.Create(CharClass.NotWordChar)); case CharClass.WhiteSpace: return(CharGroup.Create(CharClass.NotWhiteSpace)); case CharClass.NotDigit: return(CharGroup.Create(CharClass.Digit)); case CharClass.NotWordChar: return(CharGroup.Create(CharClass.WordChar)); case CharClass.NotWhiteSpace: return(CharGroup.Create(CharClass.WhiteSpace)); } return(null); }
/// <summary> /// Converts the current instance of the <see cref="CharGrouping"/> to the negative character group. /// </summary> /// <returns></returns> public CharGroup ToNegativeGroup() => CharGroup.Create(this, true);
/// <summary> /// Converts the current instance of the <see cref="CharGrouping"/> to the positive character group. /// </summary> /// <returns></returns> public CharGroup ToGroup() => CharGroup.Create(this, false);
internal CharGroupCharGroup(CharGroup group, bool negative) { _group = group ?? throw new ArgumentNullException(nameof(group)); Negative = negative; }
public override CharGroup Negate() => CharGroup.Create(_block, !_negative);
public override CharGroup Negate() => CharGroup.Create(_category, !_negative);
public override CharGroup Negate() => CharGroup.Create(_value, true);