Regular Expressions?

cdietschrun

CAGiversary!
Feedback
17 (100%)
What does this mean?

"Considering the language L: strings over {a,b} such that they contain even number (including 0) of a's. Write a regular expression corresponding to L."

This is part of a practice exam for a final for a computing class. We worked with regular expressions in such a tiny amount that this Q confuses me. I'm aware of regular expressions like ( something ) ? | (something_else)* | (something_else_yet)+ meaning how many times they expect to see one of those..zero or more or 1 or more...

Can anyone shed light on this q?
 
ah regular expressions.

I know a few :

:D;):lol::cry::roll::whistle2:#:drool::cold::hot::bomb:




i haven't done it in a while so dont know the format, but it's probably something like

B* | (AA)* | (ab*a)*
 
Yea, that's about what I had...but I have an entire page to answer, and I have no idea why. I can't think of anything else.

Then the next page gives me this one:

"The following grammar generates regular expressions over the alphabet {a,b,c}:
R -> R + R | RR | R* | a | b | c
Draw two different parse trees that can match with the string A+b*C. On the parse tree, label the grammar rules that you choose with the matching subtrees."

...What?
 
bread's done
Back
Top