static string _startupScripts_Validation(FrameworkElement fe) { //print.it("validating"); string text = (fe as TextBox).Text; if (text.NE()) { return(null); } try { var t = csvTable.parse(text); if (t.ColumnCount > 2) { return("Too many commas in a line. If script name contains comma, enclose in \"\"."); } regexp rxDelay = null; foreach (var v in t.Rows) { var s0 = v[0]; if (s0.Starts("//")) { continue; } if (App.Model.FindCodeFile(s0) == null) { return("Script not found: " + s0); } var delay = v.Length == 1 ? null : v[1]; if (!delay.NE()) { rxDelay ??= new regexp(@"(?i)^\d+ *m?s$"); if (!rxDelay.IsMatch(delay)) { return("Delay must be like 2 s or 500 ms"); } } } } catch (FormatException ex) { return(ex.Message); } return(null); }
internal RXMatch(regexp rx, string subject, int rc, in Cpp.RegexMatch k)