<s> '''<STR_LIT>''' <EOL> try : <EOL> import regex as re <EOL> except ImportError : <EOL> import re <EOL> def attrValue ( str , name ) : <EOL> prestuff , matchedName , valuePart = str . lower ( ) . partition ( "<STR_LIT>" ) <EOL> value = [ ] <EOL> endSep = None <EOL> beforeEquals = True <EOL> for c in valuePart : <EOL> if value : <EOL> if c == endSep or c . isspace ( ) or c in ( '<STR_LIT:;>' ) : <EOL> break <EOL> value . append ( c ) <EOL> elif beforeEquals : <EOL> if c == '<STR_LIT:=>' : <EOL> beforeEquals = False <EOL> else : <EOL> if c in ( '<STR_LIT:">' , "<STR_LIT:'>" ) : <EOL> endSep = c <EOL> elif c == '<STR_LIT:;>' : <EOL> break <EOL> elif not c . isspace ( ) : <EOL> value . append ( c ) <EOL> return '<STR_LIT>' . join ( value ) </s>
