Replacing Filter(Replacing repl) { var i = repl.Replacement.IndexOf('$'); if (i > 0) { // add regex to filter out already commented out regions repl.Expression = "(?<!" + RE.Regex.Escape(repl.Replacement.Substring(0, i)).Replace(@"\ ", @"\s*") + ")(?:" + repl.Expression + ")"; } return repl; }
Replacing Filter(Replacing repl) { var i = repl.Replacement.IndexOf('$'); if (i > 0) // add regex to filter out already commented out regions { repl.Expression = "(?<!" + RE.Regex.Escape(repl.Replacement.Substring(0, i)).Replace(@"\ ", @"\s*") + ")(?:" + repl.Expression + ")"; } return(repl); }
/* ----------------------------------------------------------------- */ /// /// OnReplacing /// /// <summary> /// Replacing イベントを発生させます。 /// </summary> /// /* ----------------------------------------------------------------- */ protected virtual void OnReplacing(ValueCancelEventArgs <int> e) => Replacing?.Invoke(this, e);