小编ric*_*ios的帖子

电子邮件输入中的 HTML5 输入模式中的正则表达式无效

我需要在 HTML 输入(电子邮件类型)中使用此正则表达式,我曾经在此处创建一个正则表达式来匹配我们想要验证的内容http://regexr.com/3gib9

正则表达式

/^([A-Z|a-z|0-9](\.|_){0,1})+[A-Z|a-z|0-9]\@([A-Z|a-z|0-9])+((\.){0,1}[A-Z|a-z|0-9]){2}\.(com|net|org|co|org)+((\.[A-Z|a-z|0-9]{2,4})?)$/gm
Run Code Online (Sandbox Code Playgroud)

图案

^([A-Z|a-z|0-9](\.|_){0,1})+[A-Z|a-z|0-9]\@([A-Z|a-z|0-9])+((\.){0,1}[A-Z|a-z|0-9]){2}\.(com|net|org|co|org)+((\.[A-Z|a-z|0-9]{2,4})?)$
Run Code Online (Sandbox Code Playgroud)

带图案的元素

<input type="email" pattern="^([A-Z|a-z|0-9](\.|_){0,1})+[A-Z|a-z|0-9]\@([A-Z|a-z|0-9])+((\.){0,1}[A-Z|a-z|0-9]){2}\.(com|net|org|co|org)+((\.[A-Z|a-z|0-9]{2,4})?)$" name="email" class="form-control" placeholder="email address" value="<%= session("user_email_addr") %>" required="required" title="Please input a valid email">
Run Code Online (Sandbox Code Playgroud)

现在,当我在表单中输入任何电子邮件时,我收到此错误(无效转义)

Pattern attribute value ^([A-Z|a-z|0-9](\.|_){0,1})+[A-Z|a-z|0-9]\@([A-Z|a-z|0-9])+((\.){0,1}[A-Z|a-z|0-9]){2}\.(com|net|org|co|org)+((\.[A-Z|a-z|0-9]{2,4})?)$ is not a valid regular expression: Uncaught SyntaxError: Invalid regular expression: /^([A-Z|a-z|0-9](\.|_){0,1})+[A-Z|a-z|0-9]\@([A-Z|a-z|0-9])+((\.){0,1}[A-Z|a-z|0-9]){2}\.(com|net|org|co|org)+((\.[A-Z|a-z|0-9]{2,4})?)$/: Invalid escape
Run Code Online (Sandbox Code Playgroud)

我怎样才能完成这项工作?

html javascript regex asp.net

3
推荐指数
1
解决办法
5628
查看次数

Windows服务给出错误-System.Security.SecurityException

感谢您阅读我的文章,我正在对Windows Service进行编程,当我尝试启动它时,在EventViewer上收到此错误:

Application: SerivicioBIOHAcademico.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Security.SecurityException
Stack:
   at System.Diagnostics.EventLog.FindSourceRegistration(System.String, System.String, Boolean, Boolean)
   at System.Diagnostics.EventLog.SourceExists(System.String, System.String, Boolean)
   at System.Diagnostics.EventLog.SourceExists(System.String)
   at SerivicioBIOHAcademico.BIOHAcad..ctor()
   at SerivicioBIOHAcademico.Program.Main()
Run Code Online (Sandbox Code Playgroud)

这是我的服务应用程序(C#)中的一些代码

public partial class BIOHAcad : ServiceBase
    {
        Timer timer1 = new Timer();
        private readonly string WDcon = ConfigurationManager.ConnectionStrings["WindowsFormsApplication2.Properties.Settings.DBGriauleConnectionString"].ConnectionString;
        private readonly string UJGH = ConfigurationManager.ConnectionStrings["HorariosConnection"].ConnectionString;

        public BIOHAcad()
        {
            InitializeComponent();
            if (!System.Diagnostics.EventLog.SourceExists("Fuentes-BIO-H-Academico"))
            {
                System.Diagnostics.EventLog.CreateEventSource(
                   "Fuentes-BIO-H-Academico", "Logs-BIO-H-Academico");
            }
            eventLog1.Source = "Fuentes-BIO-H-Academico";
            eventLog1.Log = "Logs-BIO-H-Academico";
        }

        protected …
Run Code Online (Sandbox Code Playgroud)

c# windows-services

2
推荐指数
1
解决办法
1万
查看次数

Php MySQL Query在托管时内存不足,资源有限

大家好,我想设置一些无法改变的重要事实:

  • 托管无法更改
  • 在php中设置的php_ini max内存不起作用
  • php.ini无法编辑
  • php无法更新

我们有一个webapi(类似于一个宁静的服务),其中有一个url,用户可以以json的方式显示.但是我们有85k +记录,当我们尝试全部刷新时,php崩溃(当我们只查看1条记录时不会发生),我们有两个代码可以使用,但它们都没有带来所有用户

版本1

<?php
//security variables
$variableName = 'name';
$variableValue = 'value';

//system variables

ob_end_flush();
ob_start();
if(isset($_GET[$variableName]) && $_GET[$variableName]== $variableValue){
    $dbVars = array();
    $query = 'SELECT * FROM users_data ';
    foreach ($_GET as $key => $value) {

        if( $key != $variableName && $key != 'sized' && $key != 'devmode'){
            array_push($dbVars, $key."='".$value."'");
        }
    }
    if( count($dbVars) > 0 ){

        $query .= 'WHERE '.implode(' AND ', $dbVars);
    }
    $result = mysql($w['database'], $query);
    $results = array();
    while($row …
Run Code Online (Sandbox Code Playgroud)

php mysql bigdata

1
推荐指数
1
解决办法
516
查看次数

标签 统计

asp.net ×1

bigdata ×1

c# ×1

html ×1

javascript ×1

mysql ×1

php ×1

regex ×1

windows-services ×1