A video of this class is (or will be) posted at: http://echo360.uml.edu/heines201516/guiprogramming1.html
Yet another wonderful post I was referred to by a friend as a follow-up to the terrorism in France
Wonderful site for test regular expressions
Interesting Firefox vs. Chrome differences in support for CSS clipping and masking
The name of the web development platform that I couldn’t think of last week is Drupal
Currently planning a final short quiz on Tuesday, December 1st
Normal characters
Character classes
[aeiou]
[a-z]
or [0-9]
[a-zA-Z0-9]
true
if it finds any one of the characters in a character class in the search string
5[1-5]\d\d\d\d\d\d\d\d\d\d\d\d\d\d
(see below)
5[1-5]\d{14}
Pattern Metacharacters
Metacharacter Interpretation Example .
Matches any single character except newline ".ba" matches barbara and yabba [cccccc]
Matches any single character listed in this set "[Vv]ariable[12]" matches variable1 and Variable2 [^cccccc]
Matches any single character not listed in this set "value[^01]" matches valuex and value2 but not value1 or value0 [c-c]
Matches any single character within the range in this set "age[5-8]" matches age5, age6, age7 and age8 $
Matches the end of a string (or line if the "m modifier is used) "txt$" matches test.txt but not test.txtfile ^
Matches the beginning of a string (or line if the "m modifier is used) "^ja" matches javascript and java but not Wow, Java’s cool! *
Matches 0 or more of the preceding regular expression "value[0-9]*" matches value1, value10 and value +
Matches 1 or more of the preceding regular expression "value[0-9]+" matches value1 and value999, but not value ?
Matches 0 or 1 of the preceding regular expression (i.e., optional) "html?" matches html and htm {quantity}
Matches exactly quantity of the preceding regular expression "value[0-9]{3}" matches value001, value010 and value123, but not value1 {min,max}
Matches at least min but no more than max of the preceding regular expression "value[0-9]{3,5}" matches value001, log0011 and log12345, but not log35 |
Matches either the expression on the left or the right of the | "Mr\.|Mrs\.|Ms\." matches Mr. or Mrs. or Ms.
Escape
SequenceInterpretation \'
Single quotation mark \"
Double quotation mark $
The $ sign \a
Alarm (a small bell sound) \b
Backspace \e
Escape \E
End \L, \Q, or \U \f
Form feed \l
Lowercase next character \L
Lowercase all following characters until \E \n
New line \Q
Backslash all following non-alphanumeric characters until \E \r
Carriage return \t
Tab \u
Uppercase next character \U
Uppercase all following characters until \E \\
Single backslash
- RegEx escape sequences
Escape
SequenceInterpretation \A
Match the beginning of a string (same as ^ if /m is not used) \B
Match a non-word boundary \b
Match a word boundary (between \w and \W) \cx
Match control character x (for example, \cC matches Ctrl/C) \d
Match a digit character [0-9] \D
Match a non-digit character [^0-9] \nnn
An octal ASCII value \s
Match a white space character [ \t\n\r\f] \S
Match a non-white space character [^ \t\n\r\f] \w
Match a “word” (alphanumeric) character [a-zA-Z_0-9] \W
Match a non-word character [^a-zA-Z_0-9] \xnn
A hexadecimal ASCII value \Z
Match the end of a string or before a new line (same as $ if /m is not used) \z
Match the end of a string
\ ^ . $ | ( ) [ ] * + ? { } ,
Syntax
var re = /ab+c/ ;Note that there are no quotes!
RegExs can be used with
exec
and test
methods of RegExp
match
, replace
, search
, and split
methods of String
String
variablesnumber
rule allows decimalsdigits
rule does not allow negative numbersinteger
rule
JavaScript Function
Test Program
Using
let
(6:47)Using
let
infor
Loops (3:54)Using
const
(4:09)