これは、数式とバイオコードを含む巨大なファイルからのサンプルピースです。一部の行は次の文字で始まります。
Sheep"-head`ed, // followed by some normal words
Mon`o*car*bon"ic, // followed by some normal words
mon`o*car"di*an, // followed by some normal words
Pol`y*chro"mate, // followed by some normal words
sheep"cot`, // followed by some normal words
baad, // followed by some normal words
正規表現は初めてです。現在、TPerlRegEx(PCREライブラリのラッパー)を使用しようとしています。抽出する必要があります:
Sheep"-head`ed,
Mon`o*car*bon"ic,
mon`o*car"di*an,
Pol`y*chro"mate,
sheep"cot`,
baad,
正規表現を書くのを手伝ってもらえますか?
どうもありがとう。
編集:
助けてくれてありがとう。法線がそれらの間にある場合:
Sheep"-head`ed, // followed by some normal words
Mon`o*car*bon"ic, // followed by some normal words
New test, //I do not want two or more than two words that end with comma.
mon`o*car"di*an, // followed by some normal words
Pol`y*chro"mate, // followed by some normal words
sheep"cot`, // followed by some normal words
baad, // I want this one word that ends with comma
私はまだ欲しい:
Sheep"-head`ed,
Mon`o*car*bon"ic,
mon`o*car"di*an,
Pol`y*chro"mate,
sheep"cot`,
baad, // I want this ONE word that ends with comma.
ありがとうございました。