Regular Expressions .net razor view core, it is possible by @Model, incoming controller in the model, then @ can write C # code, but encountered a problem, is the need to write a mailbox on the inside, there is a period like this code: var reg = "/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/";
Including the @ symbol, will get an error page, check a lot of related documents, are not related solutions.
The final solution is to add a back @ @ @ content code can be back at full output in C #, there can be full output of the $ sign.
Change the code to: var reg = "/^(\w-*\.*)+@@(\w-?)+(\.\w{2,})+$/";
problem solved.