Next: JLex Example: Expressions
Up: No Title
Previous: Regular Expressions in JLex
- [S] means any of a set of characters described by S.
[
S] means any character not described by S.
- [abc] is the same as EBNF ("a" | "b" | "c")
- [a-cxyz] is the same as EBNF ("a" | "b" | "c" | "x" | "y" | "z")
- [
xz] matches anything but x or z
- . matches everything but a newline. It is the same as [

n]
Examples:
- [0-9]+ describes integer numbers.
-
"[ 
"]*
" describes simple strings without escapes.
Q: Write JLex regular expressions for noStarOrSlash and floating
point numbers!
Christoph Zenger
3/23/2000