A video of this class is (or will be) posted at: http://echo360.uml.edu/heines201516/guiprogramming1.html
Simply add an href
attribute to the underlying HTML
<li><a href="CourseDescriptionPanel.html">Information</a></li>
The Website
The HTML to set up the tabs widget interface
The modified CSS file to style the website as I wished
What are they and why are they important?
ls -l *.cpp
ls -l assn?.cpp
RegEx Components
/.*(\d{3}).*(\d{3}).*(\d{4}).*/
replace
function
var strFormattedPhoneNumber = strPhoneNumber.replace( /.*(\d{3}).*(\d{3}).*(\d{4}).*/, "($1) $2-$3" ) ;
RegEx Example
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
Implementing Scrabble with drag-and-drop
You are welcome to help each other with graphics. For example, here is part of a row containing blank squares and double word score squares:
Please Note