Annotation of embedaddon/php/ext/ereg/tests/eregi_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test eregi() function : basic functionality - confirm case insensitivity
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : proto int eregi(string pattern, string string [, array registers])
! 6: * Description: Case-insensitive regular expression match
! 7: * Source code: ext/standard/reg.c
! 8: * Alias to functions:
! 9: */
! 10:
! 11: /*
! 12: * Test basic funtionality of eregi()
! 13: */
! 14:
! 15: echo "*** Testing eregi() : basic functionality ***\n";
! 16: $string = <<<END
! 17: UPPERCASE WORDS
! 18: lowercase words
! 19: MIxED CaSe woRdS
! 20: END;
! 21:
! 22: var_dump(eregi('words', $string, $match1));
! 23: var_dump($match1);
! 24:
! 25: var_dump(eregi('[[:lower:]]+[[:space:]]case', $string, $match2)); //character class lower should just match [a-z] but in case insensitive search matches [a-zA-Z]
! 26: var_dump($match2);
! 27: echo "Done";
! 28: ?>
! 29: --EXPECTF--
! 30: *** Testing eregi() : basic functionality ***
! 31:
! 32: Deprecated: Function eregi() is deprecated in %s on line %d
! 33: int(5)
! 34: array(1) {
! 35: [0]=>
! 36: string(5) "WORDS"
! 37: }
! 38:
! 39: Deprecated: Function eregi() is deprecated in %s on line %d
! 40: int(10)
! 41: array(1) {
! 42: [0]=>
! 43: string(10) "MIxED CaSe"
! 44: }
! 45: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>