Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help guide me through this I've been struggling to solve. Consider the following piece of dialogue from Monty Python's Search for the Holy Grail.
Please help guide me through this I've been struggling to solve.
Consider the following piece of dialogue from Monty Python's Search for the Holy Grail. Examine the underlined portion of each line and on the corresponding blank line, write a regular expression that would match. Keep in mind that the anchors (^ $) will only match the beginning and ends of whole strings but for our purposes, you can think of them as anchoring to the beginning and ending of lines. Any spaces that I want matched that exist at the beginning or end of the match pattern are marked with a Smiley Face NOTE: Answers cannot be in an "exact" form ('of the Britons.' For example) because matching those is trivial. Use PATTERNS To find matches. You may use grep to help you figure it out. For section 1, you may use extended Regex Pattern Metacharacters (+?, etc.) Dialogue Regular Expression Bridgekeeper: What... is your name? King Arthur: It is Arthur - King of the Britons. Bridgekeeper: What...O is your quest? King Arthur: To seek the Holy Grail. Bridgekeeper: What... is the air-speed velocity of an unladen swallow? King Arthur: What do you mean? An African or a European swallow? Bridgekeeper: I don't know that. Aaaaaaaaagh! For the following Section, do opposite of the previous. Read the regex and underline/highlight the portion of text that will be selected based on it. BE PRECISE Regular Expression Dialogue This parrot is no more! It has ceased to be! 'r.*e' It's expired and gone to meet its maker! 'e\s. *e' This is a late parrot! It's a stiff! 'p?.*r+ Bereft of life, it rests in peace! '.f.*fe' If you hadn't nailed it to the perch, it would be pushing up the daisies! 'p.*.i' It's run down the curtain and joined the choir invisible! 'c. *oi' 'r+.*s' This parrot is no more! It has ceased to be (intentionally repeated) This is an ex-parrot! 'p. *$' Consider the following piece of dialogue from Monty Python's Search for the Holy Grail. Examine the underlined portion of each line and on the corresponding blank line, write a regular expression that would match. Keep in mind that the anchors (^ $) will only match the beginning and ends of whole strings but for our purposes, you can think of them as anchoring to the beginning and ending of lines. Any spaces that I want matched that exist at the beginning or end of the match pattern are marked with a Smiley Face NOTE: Answers cannot be in an "exact" form ('of the Britons.' For example) because matching those is trivial. Use PATTERNS To find matches. You may use grep to help you figure it out. For section 1, you may use extended Regex Pattern Metacharacters (+?, etc.) Dialogue Regular Expression Bridgekeeper: What... is your name? King Arthur: It is Arthur - King of the Britons. Bridgekeeper: What...O is your quest? King Arthur: To seek the Holy Grail. Bridgekeeper: What... is the air-speed velocity of an unladen swallow? King Arthur: What do you mean? An African or a European swallow? Bridgekeeper: I don't know that. Aaaaaaaaagh! For the following Section, do opposite of the previous. Read the regex and underline/highlight the portion of text that will be selected based on it. BE PRECISE Regular Expression Dialogue This parrot is no more! It has ceased to be! 'r.*e' It's expired and gone to meet its maker! 'e\s. *e' This is a late parrot! It's a stiff! 'p?.*r+ Bereft of life, it rests in peace! '.f.*fe' If you hadn't nailed it to the perch, it would be pushing up the daisies! 'p.*.i' It's run down the curtain and joined the choir invisible! 'c. *oi' 'r+.*s' This parrot is no more! It has ceased to be (intentionally repeated) This is an ex-parrot! 'p. *$Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started