Question: 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
Get step-by-step solutions from verified subject matter experts
