Я хочу найти позицию начала и конца рисунка на моем тексте.pattern in regex java
Я использую следующий код:
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());
}
К сожалению, модель не находит строку в моем тексте.
Это не то, как вы используете регулярное выражение. Посмотрите на эту страницу: http://www.regular-expressions.info/tutorial.html – JREN
В строке поиска у вас больше пробелов между словами, чем в обычном поиске. Например, между «структурой» и «из» – selig
используйте регулярное выражение, только если вы не можете сделать это с помощью обычных строковых функций. – Anirudha