0
나는 내가 수정하고자하는문장 ereg_replace의 preg_replace이다
$pattern = $this->attributes['SEO_REMOVE_ALL_SPEC_CHARS'] == 'true'
? "([^[:alnum:]])+"
: "([[:punct:]])+";
이전에 설치 osCommerce의에서이 코드 조각이있다. 코드의
다음 라인은 이전에 발견 문자를 제거
$anchor = ereg_replace($pattern, '', strtolower($string));
입니다. 어떻게 내 대시를 지킬 수 있습니까?
덕분에, 마리오
편집
나는 내가 그것을 찾은 것 같아 :
$pattern = $this->attributes['SEO_REMOVE_ALL_SPEC_CHARS'] == 'true'
? "([^[:alnum:]])+"
: "([^-a-zA-Z0-9[:space:]])+";
참고 : 대시가 먼저 와야한다. 또는, 밑줄을 위해 :
$pattern = $this->attributes['SEO_REMOVE_ALL_SPEC_CHARS'] == 'true'
? "([^[:alnum:]])+"
: "([^a-zA-Z0-9_[:space:]])+";
나는 부정적인 lookaheads를 :(사용하는 방법을 알아낼하지 않았다 건배 마리오