Regular Expression used it to check the condition of the completed Form to the form that we want. Such forms Email address .
Here is a symbol of Regular Expression:
( ) : The group of options
|: Specifies that each as a separate option , which is in a group of options
+ : Indicates that you must type at least one character
* : Indicates that may have 1 or more
. : That you can type any letters or
{ } : The number of times . For example,
W {3}: specifies that you must type the letters w 3 characters in lowercase
. { 2 } : specifies that you can have at least 2 characters
. { 3.5 } : specifies that you can have at least 2 more typical 5
[ ] : That space .
[Az] +: that you can type the letters in the interval from a to z , a lowercase character
[A-dA-D-] {2,}: specifies that you can type in a range from a to d also have at least 2 characters to lowercase or uppercase
^ : That the onset of the condition or the start of the String
$ : The End of the features or the end of the String
[^ a-zA-Z0-9]: that you can type
\ : Skip
\ . : Specifies that you must type . (dot)
Literal : that you must evaluate
[a-zA-Z] + @ [a-zA-Z] + \. [a-zA-Z] +
W +
. +
ereg (regular expression, string st)
Minutes for the search expression Regular Expression in String st , seeking its sensitive Return true if it finds the contrary it return false.
Example 1 :
^[0-9]{5}(\-[0-9]{4})?$
interpretation
^ [ 0-9 ] { 5 } : means that the first sentence of Expression Number 5
\ - [ 0-9 ] { 4 } : means that we must insert - to 4 digits
( ) ? : Means that we can enter that phrase in ( ) no .
Phrase above Expression : 90001 90012-2323 .
Example 2 :
^.+@.+\.com$
^ . + : The first phrase means we have to enter any 1 or more characters .
@ : @ Literal , so we must enter @
\ . : . A literal because it is a special , so we have to put a \ before it .
Monday, May 5, 2014
11.Regular Expression
Subscribe to:
Post Comments (Atom)






0 comments:
Post a Comment