Python Regex for extracting specific part from string
Question: I have the following string:

    
    
    SOURCEFILE:  file_name.dc     : 1 : log: the logging area
    

I am trying to store anything inbetween the third and the fourth colon in a
variable and discard the rest.

I've tried to make a regular expression to grab this but so far i have this
which is wrong :

    
    
    ([^:]:[^:]*)
    

I would appreciate some help with this and an explanation of the valid regex
so i can learn from my mistake.


Answer: 
    >>> import re
    >>> s = "SOURCEFILE:  file_name.dc     : 1 : log: the logging area"
    >>> s1 = re.sub(r"[^\:]*\:[^\:]*\:[^\:]*\:([^\:]*)\:.*", r"\1", s)
    >>> print s1
    log
    

