Java Games: Flashcards, matching, concentration, and word search.

Regular Expressions 1: Vocabulary

Find the meaning of metacharacters and regex related terms.

References:
- Vikram Vaswani and Harish Kamath:
http://www.devshed.com/Server_Side/Administration/RegExp/
- Mastering Regular Expressions. Jeffrey E. F. Friedl, O'Reilly 1997
(Ch.4: http://www.oreilly.com/catalog/regex/chapter/ch04.html )
- http://212.187.69.32/HenkS/Testaregex/index.html

Apply your conceptual knowledge in:
Regular Expressions 2: Exercises ( http://www.quia.com/jg/71732.html )

About the notation used: "..." is not part of a regex, but meant to indicate the presence of some item (subexpression).

AB
"Regular Expression" (abbreviated)regex
metacharactercharacter not taken literally
literalnormal text character
anchormetacharacter matching a position
[... ] character classmatches any one of several characters
dash (-) between 2 chars in character classindicates range of chars
[^...] negated character classmatches any char not listed
dot (.)matches any character
or, bar (|)separates alternative subexpressions
parentheses (...)create subexpression (grouping)
quantifiers (?, +, *)indicate number of occurences of previous item
...? (question mark)zero or one occurences of previous item
...* (star, asterisk)zero or more occurences of previous item
...+ (plus)at least one occurence of previous item
described by a regexa set of strings satisfying certain constraints
^...begin of line (anchor)
...$end of line (anchor)
\w (lower case)part-of-word char [a-zA-Z0-9_]
\W (capital)non-word char [^w]
\d (lower case)digit [0-9]
\D (capital)non digit [^0-9]
\s (lower case)whitespace character [ \f\n\r\t\v]
\S (capital)non-whitespace character [^\s]
escapingneutralizing a metacharacter (reducing it to text)
\char (if combination is not metadescriptive)escaped char
\ttab character
\rreturn character
\nnewline character
...{min,max}repeat previous at least min times, but not more than max times
...{min,} (comma!)repeat previous item at least min times
...{num} (no comma)repeat previous item num times
groupingputting part of a regex between parentheses (creates a subexpression)
\ followed by a digitback reference to the digith subexpression (between parentheses)


Henk

This activity was created by a Quia Web subscriber.
Learn more about Quia
Create your own activities