python split statement for two string expressions
Question: I have to parse a file in which there are some expressions such as:

    
    
    (COMM_MINFULLCOMTIMEOFCHANNEL == "STD_ON" || COMM_NMLIGHTDURATIONOFCHANNEL == "STD_ON" || COMM_NMLIGHTSILENTDURATIONOFCHANNEL == "STD_ON")
    

i have parsed the expressions separately but when i have an expression like:

    
    
    (COMM_MINFULLCOMTIMEOFCHANNEL == "STD_ON" || COMM_NMLIGHTDURATIONOFCHANNEL == "STD_ON" || COMM_NMLIGHTSILENTDURATIONOFCHANNEL == "STD_ON") => COMM_KEEP_AWAKE_CHANNELS_SUPPORT == "STD_ON"
    

it shows me an error because i haven't handles the "=>" implies sign. To
handle this i have to split these expressions i think, but i dont know how to
do that. Please help!!1 Thanks in advance.


Answer: You can try using regexps. Here's an example that matches all of your blocks:

    
    
    import re
    """
    whatever code
    """
    tokens=re.findall(r"([\w\s\=\"]{3,})",line)
    """
    whatever code
    """
    

