나는 매우 약하다. regex
에 내가 할당 된 작업은 regex
이 필요하다고 생각한다. 다음 문자열이 #B#Objectives:#B#We aimed to review how personality characteristics contribute to the onset, maintenance or modulation of.#B#Method:#B#The databases Medline and PsychINFO were examined from 1967 to 2012 to
인 것으로 가정합니다.특정 패턴을 html div로 바꾸기
내 요구 사항은 #B#anystring#B#
을 <div class="format">anystring</div>
으로 바꿉니다.
나는 regex
이 필요하다고 생각하지만 정규식이 무엇인지 전혀 알지 못합니다.
의견을 보내주십시오.
이 난 그냥 <div class='formated'>
와 #B#
은 대체하지만 :#B#
가 발견되면 약간의 합병증을 추가해야 사업부의 div.The 끝의 끝을 추가하는이 now.It까지 뭘하려
String regex="#B#";
String textFormated = text.replaceAll(regex,"<div class='formated'>");
System.out.println(textFormated);
업데이트 그러나이 두 정규 표현식을 함께 사용하는 방법.
했을 도움이 될 것입니다? 시도한 코드는 무엇입니까? – Howard