import console;
import string.words;
/*
《模匹匹配快速入门》
https://www.aardio.com/zh-cn/doc/guide/language/pattern-matching.html
*/
for(k,v in string.words){
//查找 r 开头,与“人”有关的名词
if( string.find(k,"^r")
&& string.find(v,"!\wn\..*人.*")
){
console.log(k,v);
console.more(20);
}
}
/*
以函数调用方式查词则提共更多功能:
- 自动去除首尾空白字符。
- 先按以大小写敏感的方式查找,找不到则忽略大小写查找。
- 找不到单词时可自动还原词形变化,自动分析常用前缀后缀,自动拆分合成词,无分隔符时自动分词。
*/
print(string.words("howareyou"))
console.pause(true);
Markdown 格式