【发布时间】:2014-07-29 14:31:38
【问题描述】:
你好,谁能帮我用正则表达式来匹配多个空格之间的字符串
我的字符串可能如下所示:
This is just Nicolas-764 sdh and his sister
我要匹配Nicolas-764 sdh
到目前为止,我写了这个,但它匹配第一个空格之后的所有字符串
if ($string =~ m/(just) {5,}(.*) {5,}/) {
print "$1\n";
print "$2\n";
}
我想创建一个散列,其键为just,值为Nicolas-764 sdh。
我不想只匹配多个空格之间的字符串。我也需要使用just
【问题讨论】:
-
and也在多个空格之间