Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

What are three advantages of a civil service system?

Answered: 1 week ago

Question

3. Would you say that effective teamwork saved their lives?

Answered: 1 week ago