Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a regular expression for floating constants according to the following (after K&R): A floating constant consists of an integer part, a dec- imal point,

image text in transcribed

Write a regular expression for floating constants according to the following (after K&R): A floating constant consists of an integer part, a dec- imal point, a fraction part, an e, and an optionally signed integer exponent. The integer and fraction parts both consist of a sequence of digits. Either the integer part, or the fraction part (not both) may be missing; either the decimal point or the e and the exponent (not both) may be missing. You may use extended regular expression notation such as [0-9] and +, but explain what you mean by each. Hint: make sure your regular expression accepts floating constants such as 1. 0.5e-15 .3e+3 .2 le5 3.5e-4 but not inte- ger constants such as 42 Write a regular expression for floating constants according to the following (after K&R): A floating constant consists of an integer part, a dec- imal point, a fraction part, an e, and an optionally signed integer exponent. The integer and fraction parts both consist of a sequence of digits. Either the integer part, or the fraction part (not both) may be missing; either the decimal point or the e and the exponent (not both) may be missing. You may use extended regular expression notation such as [0-9] and +, but explain what you mean by each. Hint: make sure your regular expression accepts floating constants such as 1. 0.5e-15 .3e+3 .2 le5 3.5e-4 but not inte- ger constants such as 42

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

Step: 3

blur-text-image

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

AutoCAD Database Connectivity

Authors: Scott McFarlane

1st Edition

0766816400, 978-0766816404

More Books

Students also viewed these Databases questions

Question

What is group replacement? Explain with an example. (2-3 lines)

Answered: 1 week ago

Question

=+ For what reasons can and do unions go on strike?

Answered: 1 week ago