SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 76 | Next

Jonathan Snook, Aaron Gustafson, Stuart Langridge, and Dan Webb

"Accelerated DOM Scripting with Ajax, APIs, and Libraries"


The expression can be broken down into different types of tasks. First, there??™s the character
match itself. It might be an A or a Q or the number 8. Most often, it??™s a type of character or a
range of characters that you??™re looking for. A range can be defined using square brackets with a
hyphen indicating the range:
/[a-zA-Z]/
To match against any character but those in the range, just precede the range with the
caret (^) character.
/[^a-zA-Z]/
You can use \w to match any letters or numbers including the underscore (\w means
???word characters???), which would be the same as [a-zA-Z0-9_]. \W does the opposite and
matches any character that is not in that range. Likewise, you can use \d just for numbers.
To match any character but a newline character, use the period (.).
You can anchor the search to the beginning of the string, the end of the string, or both.
To ensure that the match must start at the first character, use the caret (^) character. If it
should match the last character of the string, use the dollar sign ($) character.
The following example should match any string that starts with http and ends in .html:
/^http.*\.html$/
Next there??™s checking for repetition of a particular character. You??™ve already seen a couple of
examples of this. For example, {2} means matching the character two times in a row. You can set
up ranges such as {2,4}, which means that it must match a minimum of two characters in a row
to a maximum of four characters in a row.


Pages:
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
druga wojna światowa Free English grammar and study guid hotel jelenia góra Russian bride counter strike 1.6