Question: 1 . Write regular expressions to capture the following. You may use the regular expressions meta - symbols covered in Chapter 2 , such as

1. Write regular expressions to capture the following. You may use the regular expressions meta-symbols
covered in Chapter 2, such as vertical bar and asterisk. Use single quotes (like Antlr4) or double quotes
(like Flex) around single or multiple characters in the alphabet (character literals) in the regular
expression to get an exact match. For example, use abc or "abc" to match the string abc. Be
consistent. You will need to escape a single quote or double quote (\ or \" to represent these
characters (whichever you use) when needed in C string literals. The backslash can also precede any
printable ASCII character. Some have a special meaning, such as
and \t for a newline character or
tab non-printable character when the respective string is used to generate a newline or tab when the
translated program is run. You may also need to escape the slash when a slash character is needed in
C string literal: \\.
(a) String literals in C. These are delimited by double quotes ("), and may not contain actual newline
characters. If you find it necessary you can let nl represent the actual newline character when
typing in a string. Note that this is different than
. In C, you cannot split string literals across
lines. You may find it helpful to introduce shorthand notation to represent any character that
is not a member of a small specified set. For notational convenience, let the regular expression
extension not(a1, a2,, an)=(b1|b2|...|bm), where the bis are all the characters in the alphabet other than the aj s.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!