2

鉴于 aspell 的这个输出,我怎样才能得到拼写建议:

@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.6)

& knoledge 12 0: knowledge, knowledge's, pledge, ledge, kludge, sledge, Lodge, lodge, Coolidge, Noelle, knoll, nudge

我编写了这个正则表达式:

/[a-z\']+(?=,|\z)/i  

但我知道如果第一行有逗号,它会失败。

4

1 回答 1

0

就像是:

.*:\s+(.*)

将为您提供第 1 组中的所有列表,但您仍需要解析结果以获取列表的单个元素。

在 dotall 模式下(这里可能不是你的情况):

^[^\r\n]*:\s+([^\r\n]*)$
于 2010-04-27T07:16:10.983 回答