RE: Parse the Title

Python3

You are given a list of lines representing a document:

lines = [
    "Welcome to the system guide.",
    "Section 1:Introduction to Architecture",
    "Some random body text",
    "Section 2:   Beginner State of Architecture",
    "Some random body text",
    "Section     3: Advanced Architecture."
]

Complete the function parse_headings(lines) that uses the re module to compile a regular expression with a named capturing group called title to extract the heading text following the colon.

Your Logic: