A few resources
Also
Getting started
- Get a clone of
https://github.com/ondich/cs257_2017
if you don't have it already, or "git pull" if you do.
- Open the RegularExpression project in IntelliJ, and try out my Example X's in
main().
- Comment out the Example X's code, and uncomment the command-line interface.
- Use the command-line interface version of the program to answer the questions below.
Questions
Write your answers on the wall. Do others at your table get different answers? Figure out why.
- How many times does the name "Ophelia" appear in
Hamlet?
- How many vowels are there in
Hamlet?
- Count the number of times "AA" appears in the string "AAAAA" manually. Then get
a Matcher to count them. Did you get the same number? Why or why not?
- Find all the email addresses in
Hamlet
(i.e. the Hamlet file from gutenberg.org). You'll need to think about
how to use a regular expression to identify an email address.
- Find all the words in our big word list
that contain at least one double letter (e.g. "moose" or "bookkeeper" or "ball").