Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tutorial 5 Regular Expressions and Scanning

16 views
Skip to first unread message

William

unread,
Apr 6, 2012, 8:00:24 PM4/6/12
to
Hey, I missed this tutorial so I was wondering what the answers were,
any help would be appreciated!

Regular Expression Exercise:
1) {ε}
2) {a}
3) No (Since L = {})
4) Yes {({0^0}{10})^1}({0^4}{10})
5) {x|y}{x|y}
6) No (at least {({a^?}b)^0}b{a^0}) => b)
7) {G|C|A|T}*{GACAT}{G|C|A|T}*
8) (a*(bb)*c*)*
9) {0|1}({0|1}{0|1})*
10) {(11{0|1}*{00|01|10})|({00|01|10}{0|1}*11)}
11) {0|1}*00{0|1}*
12) {-|ε}{0...9}{0...9}*.{0...9}{0...9}*

Scanning Exercise:
"1637cherry7382-"
INT 1637
ID cherry7382
MINUS -

"0x012345789-0x123-12345"
HEXINT 0x012345789
INT -0
ID x123
INT -12345

"please endthis"
ID please
?? endthis
0 new messages