QuestionQ63

VerifiedRegular Expressions

A .gif file has these attributes:

Question Image

A small data file named raw_data contains one GIF. Which of the following statements is most likely to extract the file successfully?

Explanation

A GIF stream begins with GIF (\x47\x49\x46) and terminates with the trailer byte \x3b. re.DOTALL allows .* to match newline bytes as well, so the expression can span the complete file content between those markers.

Community Discussion

No comments yet. Be the first to start the discussion!