Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a regular expression pattern that matches the same strings described in part 1a. But in addition for this pattern, ensure capture group 1 (also

Write a regular expression pattern that matches the same strings described in part 1a. But in addition for this pattern, ensure capture group 1 (also named step) is the S or None; group 2 (also named great) is some number of Gs or None; group 3 (also named grand) is the g or None; group 4 (also named basic) is the m, f, d, or s. For example, if we execute m = re.match(the-pattern, 'GGgf) then m.groups() returns (None, 'GG', 'g', 'f'); and m.groupdict() returns {'step': None, 'great': 'GG', 'grand': 'g', 'basic': 'f'}. There should be no other numbered capture groups. Hint (?:...) creates a parenthesized regular expression that is not numbered as a group. You can write one regular expression for both 1a and 1b, or you can write a simpler one for 1a (just use parentheses for grouping and ignore capture groups) and then update it for 1b by including only the necessary groups. Put your answer in repattern1b.txt

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

Computer Aided Database Design

Authors: Antonio Albano, Valeria De Antonellis, A. Di Leva

1st Edition

0444877355, 978-0444877352

More Books

Students also viewed these Databases questions