Parse log text in Python using Regex
Question: I've a format like this:

    
    
    att1="value 1" att2="value 2" att3="value 3" 
    

for example

    
    
    level="Information" clientAddr="127.0.0.1" action="GetByName" message="Action completed" url="/customers/foo" method="GET" 
    

Can I use regex to parse this? inside the values I won't have any embedded
quotes but I'll have spaces


Answer: Through findall function , you could get the values inside double quotes.

    
    
    >>> import re
    >>> m = 'level="Information" clientAddr="127.0.0.1" action="GetByName" message="Action completed" url="/customers/foo" method="GET"'
    >>> s = re.findall(r'"([^"]*)"', m)
    >>> for i in s:
    ...     print i
    ... 
    Information
    127.0.0.1
    GetByName
    Action completed
    /customers/foo
    GET
    

