With the awk.nim library
    
    
    import awk, strutils
    from nre import escapeRe
    
    let line = "    ; abc "
    
    var pos = match(line, "[^ \t\r\n\f]", theMatch) - 1
    if pos > -1:
      let isComment = match("#;", escapeRe(theMatch) )
      echo "$# $#" % [$pos, $isComment]
    

Reply via email to