티스토리 뷰
POSIX를 통한 정규표현식이 PHP 7.0.0. 부터 제거 되었기 때문에
PCRE를 사용하여야 한다. ( fnmatch()도 가능 )
- PCRE Functions
- preg_filter — Perform a regular expression search and replace
- preg_grep — Return array entries that match the pattern
- preg_last_error_msg — Returns the error message of the last PCRE regex execution
- preg_last_error — Returns the error code of the last PCRE regex execution
- preg_match_all — Perform a global regular expression match
- preg_match — Perform a regular expression match
- preg_quote — Quote regular expression characters
- preg_replace_callback_array — Perform a regular expression search and replace using callbacks
- preg_replace_callback — Perform a regular expression search and replace using a callback
- preg_replace — Perform a regular expression search and replace
- preg_split — Split string by a regular expression
http://docs.php.net/manual/en/book.pcre.php
http://docs.php.net/manual/en/ref.pcre.php
PHP: PCRE - Manual
There are no user contributed notes for this page.
docs.php.net
preg_match와 preg_match_all의 차이는 JS에서 사용되는 querySelector()와 querySelectorAll()의 차이와 같다.
preg_match는 처음 매치가 발생하면 후위 검색을 하지 않는 반면,
perg_match_all은 끝까지 패턴 일치 string이 있는지 확인한다.
preg_match( string $pattern, string $subject, array &$matches )
결과값을 $matches를 통해 반환한다.
preg_filter와 preg_replace는 패턴에 맞는 문자열을 변환하여 준다.
'오늘도 개발자 > PHP' 카테고리의 다른 글
[PHP] Date Time (0) | 2022.01.28 |
---|---|
[PHP] 함수 Function (0) | 2022.01.27 |
[PHP] 값 검증 : Validate와 Sanitize (Data Filtering) (0) | 2022.01.27 |
[PHP]CSPRNG (rand와 random_int 차이) (0) | 2022.01.26 |
[PHP] Array 스프레드 연산자 (Spread Operator in Array Expression) (0) | 2022.01.24 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- FTP권한문제
- 빛의성당
- 이전설치
- Theme Customization
- CSPRNG
- 사용자정의하기
- URL디코딩
- 코스모스팜
- 한빛미디어
- 빈화면
- 썸머노트
- 스프레드연산자
- 11번가 아마존 #우주패스 #우주쓰레기
- 철거
- 고흐1인칭시점
- wp-members
- 도스 코파스
- MySQL
- ontent
- 지대공
- 라이트세일
- wordpress #워드프레스 #url
- Lighitsail
- URL인코딩
- WordPress
- 워드프레스
- php
- url복사
- 이사
- Sanitize
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함