20-11-2012, 02:01 PM
JavaScript Regular Expressions
JavaScript Regular Expressions.ppt (Size: 172 KB / Downloads: 22)
Goals
By the end of this unit you should …
Understand what regular expressions are
Be able to use regular expressions to match text against a particular string pattern
Be able to use special regular expression characters to match multiple search terms against strings
What is a Regular Expression
A regular expression is a pattern of characters.
We use regular expressions to search for matches on particular text.
In JavaScript, we can use regular expressions by creating instances of the regular expression object, RegExp.
Non-Printing Literal Characters
We also consider some non-printing characters as literals:
(tab character)
(newline character)
(NUL character – null value)
What are Metacharacters
Metacharacters are characters used to represent special patterns that don’t necessarily fit in the range of standard letters and numbers (A-Z; a-z; 0-9, etc.).
We often use symbols as metacharacters to indicate a special circumstance.
Some of these symbols include: