I have a problem with a very simple regex.
I want to limit the entry in a multiline text field to integers only. My regular expression works fine in single-line mode (for a single TextBox line that does not use a multi-line parameter), but allows alpha characters to creep in multi-line mode, but only after entering a new line.
My code (C #) is something like:
Regex regExpr = new Regex("^(\d*)$", RegexOptions.Multiline) return regExpr.IsMatch(testString);
I want the following examples to be valid:
1 1\\n 1\\n2\\n3
I want the following to be invalid
A A1\\n2 1\\n2\\nA3
Thanks in advance.
source share