\w 匹配包括下划线的任何单词字符。等价于 '[A-Za-z0-9_]'。

解决方案 »

  1.   

    go to http://www.regexlib.com/Search.aspx, search for "word", or try\b(\w+)\b
      

  2.   

    string s = "what can we do ?";
    if(s.IndexOf("we") != -1){
       ................
    }
      

  3.   

    string.IndexOf或者用:
    Regex regb = new Regex("word");
    Console.WriteLine(regb.Replace("myword", "table"));
      

  4.   

    Thank you saucer,Only you Right.
      

  5.   

    不行了,英语太烂。 思归老大, 你的 \b(\w+)\b 只对英文正确
    可是如果有英文又有中文就行不通了。 例如我查找:  "我I Kiss ss ss 蔡sa" 中的“蔡”或 “我",就不行了。在中文查找中,整字匹配是没有意义的。\b(\w+)\b 查找中文会失败。
      

  6.   

    if you need to match Chinese, try[\u4e00-\u9fa5]+