Copyright © 2007-2021
Robert W. Hasker

CS 3040 - Note 2
Stand Back!

The Problem

Solution: regular expressions

Examples to try

How to write regular expressions?

Shorthand

Regular Expressions in ANTLR

Exercises using Standard REs

Exercises using ANTLR REs

Assignment 1: regular expression tutorial

So now you can say, stand back!

In-class Exercises

Develop regular expressions for each of the following:
  1. Pascal-style strings ("abc""xyz")
  2. C-style strings ("asdf\"asf")
  3. Floating-point numbers: 1.5e-23, 234e12, 0.54321
  4. C-style comments: /* ... */