CS 330 Lecture 5 – State Machines
Agenda
- what ?s
- state machines
- regex parts and pieces
- atoms
- alternation
- grouping
- quantifiers
- anchors
TODO
- Write on a 1/4 sheet a Ruby method
filter
that accepts an array and a block as parameters. It returns an array containing only the elements for which the block returns true. - The first homework will be assigned on Friday. Feel free to start earlier.
Design This
Design a state machine that recognizes numbers (and just numbers) like the following:
- -56
- -0.1
- 0.79
- 123.3453
- 103
Haiku
on patternal instinct
“Did you catch the plates?”
“Yes, sir. There were three numbers.
And then three letters.”
“Did you catch the plates?”
“Yes, sir. There were three numbers.
And then three letters.”