|
update : 2015.11.03
php.shukuma.com검색:
|
preg_match(PHP 4, PHP 5) preg_match — 정규표현식 매치를 수행 설명
int preg_match
( string
$pattern
, string $subject
[, array &$matches
[, int $flags
[, int $offset
]]] )
인수
반환값
preg_match()는 변경점
예제
Example #1 문자열 "php" 찾기
<?php
Example #2 단어 "Web" 찾기
<?php
Example #3 URL에서 도메인 이름 얻기
<?php위 예제의 출력: 도메인 이름은: php.net
Example #4 이름 있는 서브패턴 사용하기
<?php위 예제의 출력:
Array
(
[0] => foobar: 2008
[name] => foobar
[1] => foobar
[digit] => 2008
[2] => 2008
)
참고
|