Annotation of embedaddon/php/ext/ereg/tests/regular_expressions.inc, revision 1.1.1.1
1.1 misho 1: <?php
2:
3: /**
4: * POSIX regular expressions each coupled with a string that they match,
5: * based on documentation on http://www.tin.org/bin/man.cgi?section=7&topic=regex .
6: */
7: $expressions = array(
8: //array(pattern, string to match)
9: array('..(a|b|c)(a|b|c)..', '--- ab ---'),
10: array('()', ''),
11: array('()', 'abcdef'),
12: array('[x]|[^x]', 'abcdef'),
13: array('(a{1})(a{1,}) (b{1,3}) (c+) (d?ddd|e)', '--- aaa bbb ccc ddd ---'),
14: array('\\\\\`\^\.\[\$\(\)\|\*\+\?\{\\\'', '\\`^.[$()|*+?{\''),
15: array('\\a', 'a'),
16: array('[0-9][^0-9]', '2a'),
17: array('^[[:alnum:]]{62,62}$', '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'),
18: array('^[[:digit:]]{5}', '0123456789'),
19: array('[[:digit:]]{5}$', '0123456789'),
20: array('[[:blank:]]{1,10}', "\n \t"),
21: array('[[:print:]]{3}', " a "),
22: );
23:
24: ?>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>