많은 답변을 보았지만 아무도 내 상황에 도움이되지 못합니다.사용 방법 | 문자열 사이를 검색하기위한 preg_match의 연산자?
Comments: These are the comments and they end at this full stop. Remember, you can only use the personal information...
또는이 텍스트를 : https://regex101.com/r/apIT0O/1
하지만 수없는 것 :
이 Comments: These are the comments and they end at this full stop. You can only use the personal information...
동작하는 예제가 여기에 나는이 텍스트에서 주석을 추출해야 이것을 PHP로 가져 오십시오. 나는 함께 일할 수 있습니다 :
$pattern = "/(?<=Comments:)(.*?)(?= Remember, you can)/s";
그러나이 문제는 무엇입니까?
$pattern = "/(?<=Comments:)(.*?)(?= Remember, you can)|(?<=Comments:)(.*?)(?= You can)/s";
감사합니다.
실제로 두 사람은 캡처하려는 컨텍스트를 [일치] (https://eval.in/697037)합니다. 그러나 당신의 표현에 대해 다른 접근법을 추천합니다. – hwnd