Sorry for my late reply, and thanks for the answer. However I didn't find a 
solution for the following problem:
    
    
    import nre
    
    var
       tokens = newSeq[string]()
    
    tokens = "abc > 
def".match(re"\s*(\S+)\s*(?:>\s*(\S.*\S))?\s*").get.captures.toSeq()  # ERROR
    
    echo tokens[0]
    tokens[0] = "ghi"
    
    
    Run

The nre docs state:
    
    
    Note: If you love sequtils.toSeq we have bad news for you. This library 
doesn't work with it due to documented compiler limitations."

Suppose, this is still the problem... Is there a simpler workaround than to 
enumerate the captures, get the values, and assign to tokens? - as e.g. in
    
    
    caps = "abc > def".match(re"\s*(\S+)\s*(?:>\s*(\S.*\S))?\s*").get.captures
    
    for cap in caps:
       tokens.add(cap.get)
    
    
    Run

Reply via email to