Hello,

I hope it won't be a garbage post, because I'm missing something super simple...

I'm sending a Json from a Python script to a server written in Nim. The Json 
data is between `START` and `END` strings.
    
    
    if "START" in buf:
      buildingRecord = true
    
    if buildingRecord:
      dataBuf.add(buf)
    
    if "END" in buf and buildingRecord:
      # Extract the message.
      var matches: seq[string]
      var matched = find(dataBuf, re"START((.|\s)*)END", matches)
      
      if matched > 0:
        echo(matches[0])
    
    Run

The regex finds no matches. I hope it's not a problem with the regex itself. 
I've tested it online and it seems to work. The Json looks like so:
    
    
    {
      "start_h":10,
      "start_m":40,
      "end_h":11,
      "end_m":40,
      "delta_h":0,
      "delta_m":0,
      "project_ID":0
    }
    
    Run

It gets wrapped between `START` and `END` and pushed through a socket to the 
server. Server gets the data for sure. It just fails to extract the data with 
regex.

Reply via email to