QuestionQ13Verified/Regular ExpressionsCopy linkReport a problemAsk AstroTutorSave questionWhat output results when the following commands are entered in Python interactive mode? A['tag to go tag', 'to sans tag']B['tag to go tag', 'tag to sans tag']C['tag to go tag']D['tag to go tag to sans tag']Show AnswerAnswerExplanationIn Python regular expressions, .* is greedy by default. Between the first and final literal tag, it consumes the longest possible sequence, so re.findall() returns one string: tag to go tag to sans tag.Show comments2Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion