Annotation of embedaddon/php/ext/ereg/tests/ereg_basic_002.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test ereg() function : basic functionality (without $regs)
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : proto int ereg(string pattern, string string [, array registers])
! 6: * Description: Regular expression match
! 7: * Source code: ext/standard/reg.c
! 8: * Alias to functions:
! 9: */
! 10:
! 11: /*
! 12: * Test a number of simple, valid matches with ereg, without specifying $regs
! 13: */
! 14:
! 15: echo "*** Testing ereg() : basic functionality ***\n";
! 16:
! 17: include(dirname(__FILE__) . '/regular_expressions.inc');
! 18:
! 19: foreach ($expressions as $re) {
! 20: list($pattern,$string) = $re;
! 21: echo "--> Pattern: '$pattern'; string: '$string'\n";
! 22: var_dump(ereg($pattern, $string));
! 23: }
! 24:
! 25: echo "Done";
! 26: ?>
! 27: --EXPECTF--
! 28: *** Testing ereg() : basic functionality ***
! 29: --> Pattern: '..(a|b|c)(a|b|c)..'; string: '--- ab ---'
! 30:
! 31: Deprecated: Function ereg() is deprecated in %s on line %d
! 32: int(1)
! 33: --> Pattern: '()'; string: ''
! 34:
! 35: Deprecated: Function ereg() is deprecated in %s on line %d
! 36: int(1)
! 37: --> Pattern: '()'; string: 'abcdef'
! 38:
! 39: Deprecated: Function ereg() is deprecated in %s on line %d
! 40: int(1)
! 41: --> Pattern: '[x]|[^x]'; string: 'abcdef'
! 42:
! 43: Deprecated: Function ereg() is deprecated in %s on line %d
! 44: int(1)
! 45: --> Pattern: '(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)'; string: '--- aaa bbb ccc ddd ---'
! 46:
! 47: Deprecated: Function ereg() is deprecated in %s on line %d
! 48: int(1)
! 49: --> Pattern: '\\\`\^\.\[\$\(\)\|\*\+\?\{\''; string: '\`^.[$()|*+?{''
! 50:
! 51: Deprecated: Function ereg() is deprecated in %s on line %d
! 52: int(1)
! 53: --> Pattern: '\a'; string: 'a'
! 54:
! 55: Deprecated: Function ereg() is deprecated in %s on line %d
! 56: int(1)
! 57: --> Pattern: '[0-9][^0-9]'; string: '2a'
! 58:
! 59: Deprecated: Function ereg() is deprecated in %s on line %d
! 60: int(1)
! 61: --> Pattern: '^[[:alnum:]]{62,62}$'; string: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
! 62:
! 63: Deprecated: Function ereg() is deprecated in %s on line %d
! 64: int(1)
! 65: --> Pattern: '^[[:digit:]]{5}'; string: '0123456789'
! 66:
! 67: Deprecated: Function ereg() is deprecated in %s on line %d
! 68: int(1)
! 69: --> Pattern: '[[:digit:]]{5}$'; string: '0123456789'
! 70:
! 71: Deprecated: Function ereg() is deprecated in %s on line %d
! 72: int(1)
! 73: --> Pattern: '[[:blank:]]{1,10}'; string: '
! 74: '
! 75:
! 76: Deprecated: Function ereg() is deprecated in %s on line %d
! 77: int(1)
! 78: --> Pattern: '[[:print:]]{3}'; string: ' a '
! 79:
! 80: Deprecated: Function ereg() is deprecated in %s on line %d
! 81: int(1)
! 82: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>