Validation using RegularExpressionValidator

2010-10-09  来源:本站原创  分类:Web  人气:134 

Use RegularExpressionValidator validation:

Can only enter a number: "^ [0-9] * $"
N-bit numbers can only enter: "^ d {n} $"
Can only enter at least n digits: "^ d {n,} $"
Mn-bit input numbers only: "^ d {m, n} $"
Enter only the number zero and zero at the beginning: "^ (0 | [1-9] [0-9 ]*)$"
Can only enter a positive real number with two decimal places: "^ [0-9 ]+(.[ 0-9] {2 })?$"
1-3 decimal places can only enter a positive real number: "^ [0-9 ]+(.[ 0-9] {1,3 })?$"
Can only enter non-zero positive integer :"^+?[ 1-9] [0-9] * $ "
Can only enter non-zero negative integer :"^-[ 1-9] [0-9] * $ "
Enter only the length of 3 characters :"^.{ 3} $ "
Can only enter by the 26 English letters in the string: "^ [A-Za-z] + $"
Can only enter the 26 string composed of uppercase letters: "^ [AZ] + $"
Enter only the 26 lowercase letters a string: "^ [az] + $"
Enter only numbers and 26 letters a string: "^ [A-Za-z0-9] + $"
Can only enter by the numbers, 26 English letters or underscore a string: "^ w + $"
Verify user password: "^ [a-zA-Z] w {5,17} $" correct format: begin with a letter between the length of 6-18,

Can only contain letters, numbers and underscores.
Verify that contain characters such ^%&',;=?$" :"[^%&',;=?$ x22] + "
Can input Chinese characters: "^ [u4e00-u9fa5], {0,} $"
Verify Email Address :"^[^@]([ a-zA-Z_0-9 .])[email protected]([ a-zA-Z_0-9 .])+[^@]$"
Verify InternetURL: "^ http:// ([w-]+.)+[ w-]+(/[ w-./?%&=]*)?$"

Verify phone number :"^(( d {3,4}) | d {3,4} -)? D {7,8} $ "

asp.net validation Email address which comes with: \ w +([-+.] \ w +) * @ \ w +([-.] \ w +) * \. \ w +([-.] \ w +) *

Enter only numbers and symbols "-" ^ [\ d \ -] + $

Can only enter numbers, English, underline, in the bar line [\ w \ -] +

相关文章
  • Validation using RegularExpressionValidator 2010-10-09

    Use RegularExpressionValidator validation: Can only enter a number: "^ [0-9] * $" N-bit numbers can only enter: "^ d {n} $" Can only enter at least n digits: "^ d {n,} $" Mn-bit input numbers only: "^ d {m, n} $" En

  • VS2008 the use of validation controls 2011-05-23

    ASP.NET provides developers with a complete set of server controls to validate user input is valid. The most important validation controls are as follows: 1, RequiredFieldValidator: verify a required field, if this field Motian, then, will not be abl

  • Common JavaScript validation regular expression (change) 2009-01-30

    Chinese characters matching the regular expression: [u4e00-u9fa5] Comment: The match really is a headache for the Chinese thing, with this expression on the much easier to handle Matching double-byte characters (including the Chinese characters inclu

  • Commonly used in javascript based on regular expression text box validation code 2010-03-31

    1, can not be empty <input type="text""if(this.value.replace(/^ +| +$/g,'')=='')alert(' Cannot be empty !')"> 2 can only enter the English and the number <input"if(/[^0-9a-zA-Z]/g.test(value))alert(' There is wrong ')&quo

  • Commonly used javascript regular expression based validation code text box 2010-03-31

    1, can not be empty <input type="text""if(this.value.replace(/^ +| +$/g,'')=='')alert(' Cannot be empty !')"> 2, can only enter numbers in English and <input"if(/[^0-9a-zA-Z]/g.test(value))alert(' There is wrong ')"&

  • asp.net validation controls in the use of 2010-04-07

    Front: <h4> Validation controls by using the test </h4> <asp:TextBox runat="server"></asp:TextBox> <asp:RequiredFieldValidator runat="server" ControlToValidate="TextBox1" ValidationGroup="vGrou

  • [Change] common JavaScript validation regular expression 2010-06-01

    [Change] common JavaScript validation regular expression Chinese characters matching the regular expression: [u4e00-u9fa5] Comment: The match is a headache for the Chinese really do, with this expression is easier to handle Matching double-byte chara

  • JavaScript regular expression validation Daquan 2010-08-26

    Chinese characters matching the regular expression: [u4e00-u9fa5] Comment: The match is a headache for the Chinese really do, with this expression is easier to handle Matching double-byte characters (including Chinese characters included): [^ x00-xff

  • JavaScript regular expression validation 2010-10-19

    Chinese characters matching the regular expression: [u4e00-u9fa5] Comment: The match is a headache for the Chinese really do, with this expression is easier to handle Matching double-byte characters (including Chinese characters included): [^ x00-xff

  • Daquan JavaScript regular expression validation 2010-12-07

    Daquan JavaScript regular expression validation Chinese characters matching the regular expression: [\ u4E00-\ uFA29] Comment: The match is a headache for the Chinese really do, with this expression is easier to handle Matching double-byte characters

  • Commonly used in JavaScript regular expression validation 2010-12-31

    Here are my collection of some of the more commonly used regular expression, because usually in the form validation when possible, used more. Special issue and let you friends to use. Ha ha. Chinese characters matching the regular expression: [u4e00-

  • 3.1 Validation Controls 2011-04-28

    Validation Controls RequiredFieldValidator require users to enter in the required form field values RangeValidator detect whether a value is determined between the minimum and maximum CompareValidator to compare a value and a value or perform other d

  • Commonly used regular expression validation js 2011-05-25

    As follows: Chinese characters matching the regular expression: [u4e00-u9fa5] Comment: The match is a headache for the Chinese really do, with this expression is easier to handle Matching double-byte characters (including Chinese characters included)

  • js form validation Guinness 2009-03-03

    js form validation Guinness 1. Length <script> function test () ( if (document.abvalue.length> 50) ( alert ( "Can not more than 50 characters!"); document.abfocus (); return false; ) ) </ script> <form name=a onsubmit="ret

  • The most rapid form validation framework RapidValidation 2009-03-20

    Prototype form used for authentication method The main features of Simple, rapid test grammar Authentication prompt without writing information (of course also supports custom message) Supporting Compositional Verification Ajax support Error message

  • javascript validation 2009-05-11

    common.js // Extends the string class function // The second side spaces from strings String .prototype.trim = function()    { return this .replace(/(^[\s]*)|([\s]*$)/g, "");    };    // Delete the string left spaces String .prototype.lTrim = fu

  • common method validation js 2009-05-21

    function ChkUtil() { } // Check for null ( Delete the second side spaces and then verify that the ) ChkUtil.isNull = function (str) { if (null == str || ""== str.trim()) { return true; } else { return false; } }; // Verify all numbers ChkUtil.is

  • JSR 303 bean validation is finally out .... 2009-09-08

    JSR303 is finally out, which is dominated by hibernate, hibernate annotation in the past, now independent, and is expected to enter the Java7 (2010), after the swing / web development standards finally, the automatic binding and validation will be ..

  • js form validation control code Guinness 2009-09-26

    Keyword: js form validation Book, using JS to control form submission, javascript submit form: Contents: 1: js string length to determine the length of characters, js restrict the importation, restrictions can not be imported, textarea length limit 2

  • struts2 validation framework for configuration 2010-02-14

    It took a long time, and finally somehow, in this contempt for all kinds of mess of assorted forums, found the article a lot, not a few original, are in turn change the past, and many of the steps are not that clear, Super despise ~ ~ ~ About why the