import re
    import unicode
    
    var txt = "自我 我们 我"  # this is actually read from external file
    
    #~ txt = txt.toRunes()
    # type mismatch: got <seq[Rune]> but expected 'string'
    
    var result = txt.findall(re".{0,1}我.{0,1}")
    for i in result:
        echo i # "自我", "我们", "我" are expected
    
    
    Run

will display 
    
    
    ▒我
    我▒
     我
    
    
    Run

as the code says, if I convert txt to runes, then the txt.findall says "type 
mismatch: got <seq[Rune]> but expected 'string'". But the above code does not 
find the whole unicode characters around "我" which is not right answer

So any suggestion? Thanks 

Reply via email to