1--TEST-- 2SPL: RegexIterator::getRegex() basic tests 3--CREDITS-- 4Joshua Thijssen <jthijssen@noxlogic.nl> 5--FILE-- 6<?php 7 8$array = array('cat', 'hat', 'sat'); 9$iterator = new ArrayIterator($array); 10 11# Simple regex 12$regexIterator = new RegexIterator($iterator, '/.at/'); 13var_dump($regexIterator->getRegex()); 14 15# Empty regular expression 16$regexIterator = new RegexIterator($iterator, '//'); 17var_dump($regexIterator->getRegex()); 18 19# "Complex" email regular expression 20$regexIterator = new RegexIterator($iterator, '|\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b|'); 21var_dump($regexIterator->getRegex()); 22 23 24 25?> 26--EXPECT-- 27string(5) "/.at/" 28string(2) "//" 29string(43) "|\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b|" 30