我刚刚熟悉\Wand \S。现在我正在玩,看看他们是如何表现的,并相应地尝试了以下内容:
> s="abd12 de 5t6"
=> "abd12 de 5t6" #understood
> /\W/ =~ s
=> 5 #understood
> /\W\S/ =~ s
=> 5 #Confusion(A)
> /\S\W/ =~ s
=> 4 #Confusion(B)
> /\S/ =~ s
=> 0 #understood
>
逻辑运行的内容Part-A并将Part-B输出作为5和4。只是想在那里澄清我的概念。InPart-A 5表示 anon-word character但那也不是a non- white space charater。
我只是想知道如何IRB对待这样的陈述confusion - A and B?
谢谢