Basic Regular Expression
Abstract: The basic Regular Expression
</ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle">
<table Width="668" border="0"> <tr> <td width="387"> structure in the match
Character x x
\ \ Backslash characters
\ 0n octal value of the characters 0 n (0 <= n <= 7)
\ 0nn octal value of the characters 0 nn (0 <= n <= 7)
\ 0mnn octal value of the characters 0 mnn 0mnn (0 <= m <= 3, 0 <= n <= 7)
\ Xhh hexadecimal values of the characters 0 xhh
\ Uhhhh hexadecimal values of the characters 0 xhhhh
\ T tabs ( '\ u0009')
\ N newline ( '\ u000A')
\ R Enter at ( '\ u000D')
\ F-page website ( '\ u000C')
\ A ringing at ( '\ u0007')
\ E escaped at ( '\ u001B')
\ Cx T corresponds to the control characters x x
</ Td> <td width="271"> </ td> </ tr> </ table>
Character Class
[Abc] a, b, or c (simple)
[^ Abc] In addition to a, b or c from any of the characters (for anti-)
[A-zA-Z] a to z or A to Z, including (Scope)
[Az-[bc] a to z, in addition to b and c: [ad-z] (minus)
[Az-[mp] a to z, in addition to p m: [a-lq-z]
[Az-[^ def] d, e, f or
Pre-defined category of characters
. Arbitrary characters (may be able to terminate at the match may not)
\ D figures: [0-9]
\ D-figures: [^ 0-9]
\ S space Address: [\ t \ n \ x0B \ f \ r]
\ S-box address: [^ \ s]
\ W characters word: [a-zA-Z_0-9]
\ W-word characters: [^ \ w]
17 Regular Expression
^ \ \ D + $ / / non-negative integers (0 + positive integer)
^ * [0-9] [1-9] [0-9] * $ / / positive integers
^ ((- \ \ D +) | (0 +)) $ / / non-positive integer (negative integer + 0)
^ - [0-9] * [1-9] [0-9] * $ / / negative integers
^ -? \ \ D + $ / / Integer
^ \ \ D + (\ \. \ \ D +)? $ / / Non-negative Float (float is + 0)
^ (([0-9] + \ \. * [0-9] [1-9] [0-9 ]*)|([ 0-9] * [1-9] [0-9] * \ \. [0-9 ]+)|([ 0-9] * [1-9] [0-9 ]*))$ / / float is
^ ((- \ \ D + (\ \. \ \ D +)?)|( 0 + (\ \ .0 +)?))$ / / Non-Float (negative float + 0)
^(-(([ 0-9] + \ \. * [0-9] [1-9] [0-9 ]*)|([ 0-9] * [1-9] [0-9] * \ \. [0-9 ]+)|([ 0-9] * [1-9] [0-9 ]*)))$ / / negative float
^ (-? \ \ D +) (\ \. \ \ D +)? $ / / Float
^ [A-Za-z] + $ / / by the 26 English letters string
^ [AZ] + $ / / 26 by the English alphabetical capital of the string
^ [Az] + $ / / 26 lowercase letters of the string
^ [A-Za-z0-9] + $ / / 26 numbers and letters composed of strings
^ \ \ W + $ / / by the figures, 26 of the English letter or underscore the string
^ [\ \ W-] + (\ \. [\ \ W-]+)*@[ \ \ w-] + (\ \. [\ \ W-]+)+$ / / email addresses
^ [A-zA-z ]+://( \ \ w + (- \ \ w +)*)( \ \. (\ \ W + (- \ \ w +)*))*( \ \? \ \ S * )? $ / / url
Function TempSave (ElementID) (CommentsPersistDiv.setAttribute ( "CommentContent" document.getElementById (ElementID). Value); CommentsPersistDiv.save ( "CommentXMLStore");) function Restore (ElementID) (CommentsPersistDiv.load ( "CommentXMLStore"); document . getElementById (ElementID). CommentsPersistDiv.getAttribute value = ( "CommentContent");) </ td> </ tr> <tr>
↑ Back
Tags: basic, Regular Expression






