Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write regular expressions to match the following criteria and only the following criteria. Write regular expressions only, not Ruby code. (a) Any string that contains

Write regular expressions to match the following criteria and only the following criteria. Write regular expressions only, not Ruby code.

(a) Any string that contains an integer comprised of 3n + 1 digits, for n e N for example, these string match: "ur 8", "4002", "Ticket #3435947". These do not: "44th ain't bad.", "div-921", "[10230]"

(b) Any string whose entire contents are a septendecimal (Base-17) literal. Allow for either upper or lowercase letters.

(c) Any string that contains a block of test that begins with $$ and ends with $$. Match only a single block

(d) Any string whose entire contents are one the form CITY, State ZIP. STATE is a two letter state abbreviation. ZIP is either a 5-digit or ZIP+4 ZIP code. Capture the three pieces of information and only those three. For example, matching "Madison, New York 54703-1204" should capture "Madison", "NY", and "54703-1204"

(e) Any string that contains a sequence of space of tab characters at the end of a line. Match the whole sequence Such trialing spaces are a scourge.

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

Logic In Databases International Workshop Lid 96 San Miniato Italy July 1 2 1996 Proceedings Lncs 1154

Authors: Dino Pedreschi ,Carlo Zaniolo

1st Edition

3540618147, 978-3540618140

More Books

Students also viewed these Databases questions

Question

d. Who are important leaders and heroes of the group?

Answered: 1 week ago