Regular Expression Issue

Hello,I have an old project (built with v.2019) which use this regular expression for one of the fields:C#: @“[1][a-zA-Z0-9]{2,19}$”
JS: /[2][a-zA-Z0-9]{2,19}$/to validate the user input for a field named “UserName”, it was working perfectly.Now after upgrading the project to use the v.2020, I am facing troubles with this RegEx and get an error saying:error CS1503: Argument 2: cannot convert from ‘object’ to ‘string’

and the code line which was responsible for this:

if (!CheckByRegEx(UserName.FormValue, UserName.GetServerValidateArguments())) {
FormError = AddMessage(FormError, UserName.ErrorMessage);
}this error is repeated in 3 places: [Mytable]add.cs, [Mytable]edit.cs and [Mytable]srch.cs files.
I have followed the function GetServerValidateArguments() and found it in “aspnet.cs” with this signature:

public Func GetServerValidateArguments { get; set; } // DNI found that strange since my c# regex is a string and not an object, and the error message tells that too,
so I have tried to change its signature (in the template file: shared/config-common.cs) from:{ “prop”: “FldServerValidateArgs”, “func”: “GetServerValidateArguments”, “type”: “object” },to:{ “prop”: “FldServerValidateArgs”, “func”: “GetServerValidateArguments”, “type”: “string” },after that I was able to compile my project successfully, and the RegEx is working and verifying user inputs as expected.is this something from my code? or just a typo in the template file?


  1. a-zA-Z ↩︎

  2. a-zA-Z ↩︎

Thank you for reporting. Please update to the latest template (Tools → Update Template) and try again.

the new template is almost the same as the previous one (17.0.3.6), the only difference is the increased version number.

The new template will update also the node module under the installation folder. Please make sure that you have Administrative rights to modify the installation folder.If not, login with Admin rights, uninstall and reinstall, then click Tools → Update Template again.