
getRegex 메서드는 RegexIterator의 인스턴스에서 호출할 수 있으며, 이 메서드는 생성된 정규표현식의 패턴을 반환합니다. 반환값은 문자열 형태로 반환됩니다.
예를 들어, 다음과 같이 RegexIterator를 생성하고 getRegex 메서드를 호출할 수 있습니다.
#hostingforum.kr
php
$iterator = new RegexIterator(new ArrayIterator(['hello', 'world']), '/hello/');
echo $iterator->getRegex(); // 출력: /hello/
이 예제에서 getRegex 메서드는 생성된 정규표현식의 패턴 '/hello/'를 문자열 형태로 반환합니다.
2025-07-05 06:53