テキストのパターンの開始位置と終了位置を見つけたいです。
次のコードを使用します。
Pattern _pat=Pattern.compile("20. Eslaminejad MB, Nikmahzar A, Piriea A. The structure of "
+"Human Mesenchymal Stem Cells differentiated into cartilage in micro mass culture system. Yakhteh 2006, 8(3): "
+"162-171.");
Matcher _match=_pat.matcher("19. Eslaminejad MB, Eftekhari-Yazdi P. Mesenchymal stem "
+"cells: In vitro differentiation among bone and cartilage cell "
+"lineages. Yakhteh. 2007; 9(3): 158-169."
+"20. Eslaminejad MB, Nikmahzar A, Piriea A. The structure of "
+"Human Mesenchymal Stem Cells differentiated into cartilage in micro mass culture system. Yakhteh 2006, 8(3): "
+"162-171."
+"21. Pioletti DP, Montjovent MO, Zambelli PY, Applegate L. "
+"Bone tissue engineering using foetal cell therapy. Swiss "
+"Med Wkly. 2006 ; 136(35-36): 557-560.");
while(_match.find()){
System.out.println(_match.start());
System.out.println(_match.end());
}
残念ながら、パターンはテキスト内の文字列を見つけられません。