# PaCkAgE DaTaStReAm SMCpcre 1 2678 # end of header 0707010004d7c6000081a40000000a0000000a00000001402cbe23000000a80000008800000005000000000000000000000010ff350887SMCpcre/pkginfoPKG=SMCpcre NAME=pcre ARCH=sparc VERSION=4.5 CATEGORY=application VENDOR=Philip Hazel EMAIL=steve@smc.vnet.net PSTAMP=Steve Christensen BASEDIR=/usr/local CLASSES=none 0707010004d7c5000081a40000000a0000000a00000001402cbe2300002040000000880000000500000000000000000000000fff350887SMCpcre/pkgmap: 1 2678 1 d none bin 0755 root bin 1 f none bin/pcre-config 0755 root bin 1110 15305 1076673727 1 f none bin/pcregrep 0755 root bin 34128 50910 1076673726 1 f none bin/pcretest 0755 root bin 69156 55457 1076673727 1 d none doc 0755 root bin 1 d none doc/pcre 0755 root bin 1 f none doc/pcre/AUTHORS 0644 root bin 179 14742 1076673893 1 f none doc/pcre/COPYING 0644 root bin 2218 63342 1076673893 1 f none doc/pcre/ChangeLog 0644 root bin 64875 48637 1076673893 1 f none doc/pcre/INSTALL 0644 root bin 8049 54099 1076673893 1 f none doc/pcre/LICENCE 0644 root bin 2218 63342 1076673893 1 f none doc/pcre/NEWS 0644 root bin 6142 2245 1076673893 1 f none doc/pcre/NON-UNIX-USE 0644 root bin 5381 16910 1076673893 1 f none doc/pcre/README 0644 root bin 16781 23746 1076673893 1 d none doc/pcre/doc 0755 root bin 1 f none doc/pcre/doc/Tech.Notes 0644 root bin 11442 5252 1076673892 1 d none doc/pcre/doc/html 0755 root bin 1 f none doc/pcre/doc/html/index.html 0644 root bin 3814 3968 1076673892 1 f none doc/pcre/doc/html/pcre.html 0644 root bin 7869 24333 1076673892 1 f none doc/pcre/doc/html/pcre_compile.html 0644 root bin 2306 49902 1076673893 1 f none doc/pcre/doc/html/pcre_config.html 0644 root bin 1681 2288 1076673893 1 f none doc/pcre/doc/html/pcre_copy_named_substring.html 0644 root bin 1502 59955 1076673893 1 f none doc/pcre/doc/html/pcre_copy_substring.html 0644 root bin 1371 49181 1076673893 1 f none doc/pcre/doc/html/pcre_exec.html 0644 root bin 1914 22973 1076673893 1 f none doc/pcre/doc/html/pcre_free_substring.html 0644 root bin 819 3794 1076673893 1 f none doc/pcre/doc/html/pcre_free_substring_list.html 0644 root bin 815 3692 1076673893 1 f none doc/pcre/doc/html/pcre_fullinfo.html 0644 root bin 2098 32458 1076673893 1 f none doc/pcre/doc/html/pcre_get_named_substring.html 0644 root bin 1423 53603 1076673893 1 f none doc/pcre/doc/html/pcre_get_stringnumber.html 0644 root bin 1022 20205 1076673893 1 f none doc/pcre/doc/html/pcre_get_substring.html 0644 root bin 1319 45386 1076673893 1 f none doc/pcre/doc/html/pcre_get_substring_list.html 0644 root bin 1187 33907 1076673893 1 f none doc/pcre/doc/html/pcre_info.html 0644 root bin 729 60046 1076673893 1 f none doc/pcre/doc/html/pcre_maketables.html 0644 root bin 925 12715 1076673893 1 f none doc/pcre/doc/html/pcre_study.html 0644 root bin 1282 42713 1076673893 1 f none doc/pcre/doc/html/pcre_version.html 0644 root bin 703 58485 1076673893 1 f none doc/pcre/doc/html/pcreapi.html 0644 root bin 51200 30745 1076673893 1 f none doc/pcre/doc/html/pcrebuild.html 0644 root bin 7078 12388 1076673893 1 f none doc/pcre/doc/html/pcrecallout.html 0644 root bin 4554 455 1076673893 1 f none doc/pcre/doc/html/pcrecompat.html 0644 root bin 4918 25915 1076673893 1 f none doc/pcre/doc/html/pcregrep.html 0644 root bin 4979 27365 1076673892 1 f none doc/pcre/doc/html/pcrepattern.html 0644 root bin 60320 8964 1076673893 1 f none doc/pcre/doc/html/pcreperform.html 0644 root bin 3459 41813 1076673893 1 f none doc/pcre/doc/html/pcreposix.html 0644 root bin 8945 33143 1076673893 1 f none doc/pcre/doc/html/pcresample.html 0644 root bin 2438 13156 1076673893 1 f none doc/pcre/doc/html/pcretest.html 0644 root bin 16742 41637 1076673892 1 f none doc/pcre/doc/pcre.3 0644 root bin 6924 18667 1076673893 1 f none doc/pcre/doc/pcre.txt 0644 root bin 151738 4034 1076673893 1 f none doc/pcre/doc/pcre_compile.3 0644 root bin 1912 19271 1076673893 1 f none doc/pcre/doc/pcre_config.3 0644 root bin 1276 35420 1076673893 1 f none doc/pcre/doc/pcre_copy_named_substring.3 0644 root bin 1130 30616 1076673893 1 f none doc/pcre/doc/pcre_copy_substring.3 0644 root bin 1003 20198 1076673893 1 f none doc/pcre/doc/pcre_exec.3 0644 root bin 1536 59560 1076673893 1 f none doc/pcre/doc/pcre_free_substring.3 0644 root bin 483 41356 1076673893 1 f none doc/pcre/doc/pcre_free_substring_list.3 0644 root bin 475 40666 1076673893 1 f none doc/pcre/doc/pcre_fullinfo.3 0644 root bin 1686 827 1076673893 1 f none doc/pcre/doc/pcre_get_named_substring.3 0644 root bin 1054 24303 1076673893 1 f none doc/pcre/doc/pcre_get_stringnumber.3 0644 root bin 658 55955 1076673893 1 f none doc/pcre/doc/pcre_get_substring.3 0644 root bin 954 16442 1076673893 1 f none doc/pcre/doc/pcre_get_substring_list.3 0644 root bin 817 4236 1076673893 1 f none doc/pcre/doc/pcre_info.3 0644 root bin 398 32843 1076673893 1 f none doc/pcre/doc/pcre_maketables.3 0644 root bin 594 50692 1076673893 1 f none doc/pcre/doc/pcre_study.3 0644 root bin 918 13758 1076673893 1 f none doc/pcre/doc/pcre_version.3 0644 root bin 377 31104 1076673893 1 f none doc/pcre/doc/pcreapi.3 0644 root bin 47162 61802 1076673893 1 f none doc/pcre/doc/pcrebuild.3 0644 root bin 5635 42953 1076673893 1 f none doc/pcre/doc/pcrecallout.3 0644 root bin 3922 22436 1076673893 1 f none doc/pcre/doc/pcrecompat.3 0644 root bin 4355 49884 1076673893 1 f none doc/pcre/doc/pcregrep.1 0644 root bin 4058 27840 1076673893 1 f none doc/pcre/doc/pcregrep.txt 0644 root bin 4815 39279 1076673893 1 f none doc/pcre/doc/pcrepattern.3 0644 root bin 55268 11951 1076673893 1 f none doc/pcre/doc/pcreperform.3 0644 root bin 2945 2712 1076673893 1 f none doc/pcre/doc/pcreposix.3 0644 root bin 7574 5571 1076673893 1 f none doc/pcre/doc/pcresample.3 0644 root bin 1915 39558 1076673893 1 f none doc/pcre/doc/pcretest.1 0644 root bin 15127 7218 1076673893 1 f none doc/pcre/doc/pcretest.txt 0644 root bin 16738 14011 1076673893 1 f none doc/pcre/doc/perltest.txt 0644 root bin 1706 22567 1076673893 1 d none include 0755 root bin 1 f none include/pcre.h 0644 root bin 7038 8324 1076673725 1 f none include/pcreposix.h 0644 root bin 2347 48653 1076673725 1 d none lib 0755 root bin 1 f none lib/libpcre.a 0644 root bin 144348 2039 1076673722 1 f none lib/libpcre.la 0755 root bin 706 59504 1076673722 1 s none lib/libpcre.so=libpcre.so.0.0.1 1 s none lib/libpcre.so.0=libpcre.so.0.0.1 1 f none lib/libpcre.so.0.0.1 0755 root bin 132632 26822 1076673722 1 f none lib/libpcreposix.a 0644 root bin 16780 5683 1076673724 1 f none lib/libpcreposix.la 0755 root bin 767 296 1076673724 1 s none lib/libpcreposix.so=libpcreposix.so.0.0.0 1 s none lib/libpcreposix.so.0=libpcreposix.so.0.0.0 1 f none lib/libpcreposix.so.0.0.0 0755 root bin 18688 33666 1076673724 1 d none man 0755 root bin 1 d none man/man1 0755 root bin 1 f none man/man1/pcregrep.1 0644 root bin 4058 27840 1076673725 1 f none man/man1/pcretest.1 0644 root bin 15127 7218 1076673725 1 d none man/man3 0755 root bin 1 f none man/man3/pcre.3 0644 root bin 6924 18667 1076673725 1 f none man/man3/pcre_compile.3 0644 root bin 1912 19271 1076673725 1 f none man/man3/pcre_config.3 0644 root bin 1276 35420 1076673725 1 f none man/man3/pcre_copy_named_substring.3 0644 root bin 1130 30616 1076673725 1 f none man/man3/pcre_copy_substring.3 0644 root bin 1003 20198 1076673725 1 f none man/man3/pcre_exec.3 0644 root bin 1536 59560 1076673725 1 f none man/man3/pcre_free_substring.3 0644 root bin 483 41356 1076673725 1 f none man/man3/pcre_free_substring_list.3 0644 root bin 475 40666 1076673725 1 f none man/man3/pcre_fullinfo.3 0644 root bin 1686 827 1076673725 1 f none man/man3/pcre_get_named_substring.3 0644 root bin 1054 24303 1076673725 1 f none man/man3/pcre_get_stringnumber.3 0644 root bin 658 55955 1076673725 1 f none man/man3/pcre_get_substring.3 0644 root bin 954 16442 1076673725 1 f none man/man3/pcre_get_substring_list.3 0644 root bin 817 4236 1076673725 1 f none man/man3/pcre_info.3 0644 root bin 398 32843 1076673725 1 f none man/man3/pcre_maketables.3 0644 root bin 594 50692 1076673725 1 f none man/man3/pcre_study.3 0644 root bin 918 13758 1076673725 1 f none man/man3/pcre_version.3 0644 root bin 377 31104 1076673725 1 f none man/man3/pcreapi.3 0644 root bin 47162 61802 1076673725 1 f none man/man3/pcrebuild.3 0644 root bin 5635 42953 1076673725 1 f none man/man3/pcrecallout.3 0644 root bin 3922 22436 1076673725 1 f none man/man3/pcrecompat.3 0644 root bin 4355 49884 1076673725 1 f none man/man3/pcrepattern.3 0644 root bin 55268 11951 1076673725 1 f none man/man3/pcreperform.3 0644 root bin 2945 2712 1076673725 1 f none man/man3/pcreposix.3 0644 root bin 7574 5571 1076673725 1 f none man/man3/pcresample.3 0644 root bin 1915 39558 1076673725 1 i pkginfo 168 13981 1076674083 07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!!0707010004d7c6000081a40000000a0000000a00000001402cbe23000000a8000000880000000500000000000000000000000800000000pkginfoPKG=SMCpcre NAME=pcre ARCH=sparc VERSION=4.5 CATEGORY=application VENDOR=Philip Hazel EMAIL=steve@smc.vnet.net PSTAMP=Steve Christensen BASEDIR=/usr/local CLASSES=none 0707010004d7c5000081a40000000a0000000a00000001402cbe2300002040000000880000000500000000000000000000000700000000pkgmap: 1 2678 1 d none bin 0755 root bin 1 f none bin/pcre-config 0755 root bin 1110 15305 1076673727 1 f none bin/pcregrep 0755 root bin 34128 50910 1076673726 1 f none bin/pcretest 0755 root bin 69156 55457 1076673727 1 d none doc 0755 root bin 1 d none doc/pcre 0755 root bin 1 f none doc/pcre/AUTHORS 0644 root bin 179 14742 1076673893 1 f none doc/pcre/COPYING 0644 root bin 2218 63342 1076673893 1 f none doc/pcre/ChangeLog 0644 root bin 64875 48637 1076673893 1 f none doc/pcre/INSTALL 0644 root bin 8049 54099 1076673893 1 f none doc/pcre/LICENCE 0644 root bin 2218 63342 1076673893 1 f none doc/pcre/NEWS 0644 root bin 6142 2245 1076673893 1 f none doc/pcre/NON-UNIX-USE 0644 root bin 5381 16910 1076673893 1 f none doc/pcre/README 0644 root bin 16781 23746 1076673893 1 d none doc/pcre/doc 0755 root bin 1 f none doc/pcre/doc/Tech.Notes 0644 root bin 11442 5252 1076673892 1 d none doc/pcre/doc/html 0755 root bin 1 f none doc/pcre/doc/html/index.html 0644 root bin 3814 3968 1076673892 1 f none doc/pcre/doc/html/pcre.html 0644 root bin 7869 24333 1076673892 1 f none doc/pcre/doc/html/pcre_compile.html 0644 root bin 2306 49902 1076673893 1 f none doc/pcre/doc/html/pcre_config.html 0644 root bin 1681 2288 1076673893 1 f none doc/pcre/doc/html/pcre_copy_named_substring.html 0644 root bin 1502 59955 1076673893 1 f none doc/pcre/doc/html/pcre_copy_substring.html 0644 root bin 1371 49181 1076673893 1 f none doc/pcre/doc/html/pcre_exec.html 0644 root bin 1914 22973 1076673893 1 f none doc/pcre/doc/html/pcre_free_substring.html 0644 root bin 819 3794 1076673893 1 f none doc/pcre/doc/html/pcre_free_substring_list.html 0644 root bin 815 3692 1076673893 1 f none doc/pcre/doc/html/pcre_fullinfo.html 0644 root bin 2098 32458 1076673893 1 f none doc/pcre/doc/html/pcre_get_named_substring.html 0644 root bin 1423 53603 1076673893 1 f none doc/pcre/doc/html/pcre_get_stringnumber.html 0644 root bin 1022 20205 1076673893 1 f none doc/pcre/doc/html/pcre_get_substring.html 0644 root bin 1319 45386 1076673893 1 f none doc/pcre/doc/html/pcre_get_substring_list.html 0644 root bin 1187 33907 1076673893 1 f none doc/pcre/doc/html/pcre_info.html 0644 root bin 729 60046 1076673893 1 f none doc/pcre/doc/html/pcre_maketables.html 0644 root bin 925 12715 1076673893 1 f none doc/pcre/doc/html/pcre_study.html 0644 root bin 1282 42713 1076673893 1 f none doc/pcre/doc/html/pcre_version.html 0644 root bin 703 58485 1076673893 1 f none doc/pcre/doc/html/pcreapi.html 0644 root bin 51200 30745 1076673893 1 f none doc/pcre/doc/html/pcrebuild.html 0644 root bin 7078 12388 1076673893 1 f none doc/pcre/doc/html/pcrecallout.html 0644 root bin 4554 455 1076673893 1 f none doc/pcre/doc/html/pcrecompat.html 0644 root bin 4918 25915 1076673893 1 f none doc/pcre/doc/html/pcregrep.html 0644 root bin 4979 27365 1076673892 1 f none doc/pcre/doc/html/pcrepattern.html 0644 root bin 60320 8964 1076673893 1 f none doc/pcre/doc/html/pcreperform.html 0644 root bin 3459 41813 1076673893 1 f none doc/pcre/doc/html/pcreposix.html 0644 root bin 8945 33143 1076673893 1 f none doc/pcre/doc/html/pcresample.html 0644 root bin 2438 13156 1076673893 1 f none doc/pcre/doc/html/pcretest.html 0644 root bin 16742 41637 1076673892 1 f none doc/pcre/doc/pcre.3 0644 root bin 6924 18667 1076673893 1 f none doc/pcre/doc/pcre.txt 0644 root bin 151738 4034 1076673893 1 f none doc/pcre/doc/pcre_compile.3 0644 root bin 1912 19271 1076673893 1 f none doc/pcre/doc/pcre_config.3 0644 root bin 1276 35420 1076673893 1 f none doc/pcre/doc/pcre_copy_named_substring.3 0644 root bin 1130 30616 1076673893 1 f none doc/pcre/doc/pcre_copy_substring.3 0644 root bin 1003 20198 1076673893 1 f none doc/pcre/doc/pcre_exec.3 0644 root bin 1536 59560 1076673893 1 f none doc/pcre/doc/pcre_free_substring.3 0644 root bin 483 41356 1076673893 1 f none doc/pcre/doc/pcre_free_substring_list.3 0644 root bin 475 40666 1076673893 1 f none doc/pcre/doc/pcre_fullinfo.3 0644 root bin 1686 827 1076673893 1 f none doc/pcre/doc/pcre_get_named_substring.3 0644 root bin 1054 24303 1076673893 1 f none doc/pcre/doc/pcre_get_stringnumber.3 0644 root bin 658 55955 1076673893 1 f none doc/pcre/doc/pcre_get_substring.3 0644 root bin 954 16442 1076673893 1 f none doc/pcre/doc/pcre_get_substring_list.3 0644 root bin 817 4236 1076673893 1 f none doc/pcre/doc/pcre_info.3 0644 root bin 398 32843 1076673893 1 f none doc/pcre/doc/pcre_maketables.3 0644 root bin 594 50692 1076673893 1 f none doc/pcre/doc/pcre_study.3 0644 root bin 918 13758 1076673893 1 f none doc/pcre/doc/pcre_version.3 0644 root bin 377 31104 1076673893 1 f none doc/pcre/doc/pcreapi.3 0644 root bin 47162 61802 1076673893 1 f none doc/pcre/doc/pcrebuild.3 0644 root bin 5635 42953 1076673893 1 f none doc/pcre/doc/pcrecallout.3 0644 root bin 3922 22436 1076673893 1 f none doc/pcre/doc/pcrecompat.3 0644 root bin 4355 49884 1076673893 1 f none doc/pcre/doc/pcregrep.1 0644 root bin 4058 27840 1076673893 1 f none doc/pcre/doc/pcregrep.txt 0644 root bin 4815 39279 1076673893 1 f none doc/pcre/doc/pcrepattern.3 0644 root bin 55268 11951 1076673893 1 f none doc/pcre/doc/pcreperform.3 0644 root bin 2945 2712 1076673893 1 f none doc/pcre/doc/pcreposix.3 0644 root bin 7574 5571 1076673893 1 f none doc/pcre/doc/pcresample.3 0644 root bin 1915 39558 1076673893 1 f none doc/pcre/doc/pcretest.1 0644 root bin 15127 7218 1076673893 1 f none doc/pcre/doc/pcretest.txt 0644 root bin 16738 14011 1076673893 1 f none doc/pcre/doc/perltest.txt 0644 root bin 1706 22567 1076673893 1 d none include 0755 root bin 1 f none include/pcre.h 0644 root bin 7038 8324 1076673725 1 f none include/pcreposix.h 0644 root bin 2347 48653 1076673725 1 d none lib 0755 root bin 1 f none lib/libpcre.a 0644 root bin 144348 2039 1076673722 1 f none lib/libpcre.la 0755 root bin 706 59504 1076673722 1 s none lib/libpcre.so=libpcre.so.0.0.1 1 s none lib/libpcre.so.0=libpcre.so.0.0.1 1 f none lib/libpcre.so.0.0.1 0755 root bin 132632 26822 1076673722 1 f none lib/libpcreposix.a 0644 root bin 16780 5683 1076673724 1 f none lib/libpcreposix.la 0755 root bin 767 296 1076673724 1 s none lib/libpcreposix.so=libpcreposix.so.0.0.0 1 s none lib/libpcreposix.so.0=libpcreposix.so.0.0.0 1 f none lib/libpcreposix.so.0.0.0 0755 root bin 18688 33666 1076673724 1 d none man 0755 root bin 1 d none man/man1 0755 root bin 1 f none man/man1/pcregrep.1 0644 root bin 4058 27840 1076673725 1 f none man/man1/pcretest.1 0644 root bin 15127 7218 1076673725 1 d none man/man3 0755 root bin 1 f none man/man3/pcre.3 0644 root bin 6924 18667 1076673725 1 f none man/man3/pcre_compile.3 0644 root bin 1912 19271 1076673725 1 f none man/man3/pcre_config.3 0644 root bin 1276 35420 1076673725 1 f none man/man3/pcre_copy_named_substring.3 0644 root bin 1130 30616 1076673725 1 f none man/man3/pcre_copy_substring.3 0644 root bin 1003 20198 1076673725 1 f none man/man3/pcre_exec.3 0644 root bin 1536 59560 1076673725 1 f none man/man3/pcre_free_substring.3 0644 root bin 483 41356 1076673725 1 f none man/man3/pcre_free_substring_list.3 0644 root bin 475 40666 1076673725 1 f none man/man3/pcre_fullinfo.3 0644 root bin 1686 827 1076673725 1 f none man/man3/pcre_get_named_substring.3 0644 root bin 1054 24303 1076673725 1 f none man/man3/pcre_get_stringnumber.3 0644 root bin 658 55955 1076673725 1 f none man/man3/pcre_get_substring.3 0644 root bin 954 16442 1076673725 1 f none man/man3/pcre_get_substring_list.3 0644 root bin 817 4236 1076673725 1 f none man/man3/pcre_info.3 0644 root bin 398 32843 1076673725 1 f none man/man3/pcre_maketables.3 0644 root bin 594 50692 1076673725 1 f none man/man3/pcre_study.3 0644 root bin 918 13758 1076673725 1 f none man/man3/pcre_version.3 0644 root bin 377 31104 1076673725 1 f none man/man3/pcreapi.3 0644 root bin 47162 61802 1076673725 1 f none man/man3/pcrebuild.3 0644 root bin 5635 42953 1076673725 1 f none man/man3/pcrecallout.3 0644 root bin 3922 22436 1076673725 1 f none man/man3/pcrecompat.3 0644 root bin 4355 49884 1076673725 1 f none man/man3/pcrepattern.3 0644 root bin 55268 11951 1076673725 1 f none man/man3/pcreperform.3 0644 root bin 2945 2712 1076673725 1 f none man/man3/pcreposix.3 0644 root bin 7574 5571 1076673725 1 f none man/man3/pcresample.3 0644 root bin 1915 39558 1076673725 1 i pkginfo 168 13981 1076674083 0707010004e685000041ed0000000a0000000a00000007402cbe2400000000000000880000000500000000000000000000000600000000reloc0707010004d7c7000041ed0000000a0000000a00000002402cbe2300000000000000880000000500000000000000000000000a00000000reloc/bin0707010004d7c8000081a40000000a0000000a00000001402cbcbf000004560000008800000005000000000000000000000016ff350889reloc/bin/pcre-config#!/bin/sh prefix=/usr/local exec_prefix=${prefix} exec_prefix_set=no usage="\ Usage: pcre-config [--prefix] [--exec-prefix] [--version] [--libs] [--libs-posix] [--cflags] [--cflags-posix]" if test $# -eq 0; then echo "${usage}" 1>&2 exit 1 fi while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case $1 in --prefix=*) prefix=$optarg if test $exec_prefix_set = no ; then exec_prefix=$optarg fi ;; --prefix) echo $prefix ;; --exec-prefix=*) exec_prefix=$optarg exec_prefix_set=yes ;; --exec-prefix) echo $exec_prefix ;; --version) echo 4.5 ;; --cflags | --cflags-posix) if test ${prefix}/include != /usr/include ; then includes=-I${prefix}/include fi echo $includes ;; --libs-posix) echo -L${exec_prefix}/lib -lpcreposix -lpcre ;; --libs) echo -L${exec_prefix}/lib -lpcre ;; *) echo "${usage}" 1>&2 exit 1 ;; esac shift done 0707010004d7c9000081a40000000a0000000a00000001402cbcbe000085500000008800000005000000000000000000000013ff350889reloc/bin/pcregrepELF4x4 (44 - - 0 0D!!/usr/lib/ld.so.1// !"$%&(*+,.  #')-t ! %#.!l54 ; XU!^ f l!$v!}%@!!0!< !' #!!  -   !`# #t! # !8 " )!T2H ? S!\!c!n's" !x!H 0 %@!_startstrlen__register_frame_info_environfwrite_fini_PROCEDURE_LINKAGE_TABLE_closedirreaddir_exitpcre_execmalloc__iobpcre_compilefprintffopen_initprintferrnostatenvironfgets_etextopendirmemcmpsprintf__ctype_edatapcre_version__deregister_frame_info_ctypemainatexitstrerror_lib_version_Jv_RegisterClasses_DYNAMICstrcmppcre_study_end__dso_handleexitputsfclose_GLOBAL_OFFSET_TABLE__ioblibc.so.1SISCD_2.3libpcre.so.0libc.so.1/usr/local/libzt T$ P L#% #' ! *    $    !! !!$ !0!<!H,!T"!`!l!x+!!! !!'!& @D# @EF 4@E@, @ "@K@E@E㿐/E#`  @  `@@`" `@$@``` ``@E`  +㿐㿐/Eή` ``@E ```$ `@E㿐h@E  |< @@ ` Ѱ`/`㿐%F'F@Ep   @El @Ee  a   `$@EW u@EU  Hzo` "g?'㘸 ' -+` c;c,`@#\#` @E8 82   c` d@@? `㘀@c c` c` c`; `!F!b@E c` FF!b@E !b@DF` FFb! @DTb(zpc``!Fb@Dߐ!F!b㻐7  `(F@D͒b c` @ `?@ Q@D;@DcFc@D!/  !%F`(@D   `?`? @? @DcFђc8㿐  J!F!@D#hF!# @Dz -㿀F@Dv#G@Ds G@Dp XG@Dm G@Dj b*b +G)G'G-G/ `@DQ @DU` $耢` ' @DK `G ''G@D:!G@D7!0G@D4! dG@D3!G@D-!G@D*"8㿐n;n@uh;,iVGc G!@Cb @C  ? cGb!@C!@CGb@C!  l  c % c#`! buvrs  c  c x ` c  chx  #  @L`-L    -  ?(`8``f|  (```@C!3&c@C!c9`'# /㔀 o, 0@ܖ@C c @X)#`%## @c,`@ @Cv#܀. @#`@c!c? `? ' $#,c@a`?`? @? ɐ !0#`Gb@C'G!b@C /G!c(F)b@C F;$@B ;@B#`c-c ? @ ` ? ?@ `2?+@B #c` (`%##@G!@BɒcXg G dc@B!_ @BÐ^#@Bc㔖Fc!G  #@BH  ##L `2`@##G# @B % @Bh H @B{`   cb` b`2@H!@Bu`0@ @B  "  `2@@Q㿐/Bh`@?㿐㿠㿠Ohelpdisplay this help and exitcountprint only a count of matching lines per FILEno-filenamesuppress the prefixing filename on outputignore-caseignore case distinctionsfiles-with-matchesprint only FILE names containing matchesline-numberprint line number with output linesrecursiverecursively scan sub-directoriesno-messagessuppress error messagesutf-8use UTF-8 modeversionprint version information and exitinvert-matchselect non-matching linesline-regexforce PATTERN to match only whole linesline-regexp...%s:%d:%s %d rpcregrep: Failed to open %s: %s %.512s%c%.128spcregrep: Failed to open directory %s: %s Usage: pcregrep [-Vcfhilnrsvx] [long-options] [pattern] [file1 file2 ...] Type `pcregrep --help' for more information. Usage: pcregrep [OPTION]... [PATTERN] [FILE1 FILE2 ...]Search for PATTERN in each FILE or standard input.PATTERN must be present if -f is not used.Example: pcregrep -i 'hello.*world' menu.h main.c Options: %s --%s%n%.*s%s -%c, -f or --file= Read patterns from instead of using a command line option. Trailing white space is removed; blanks lines are ignored. There is a maximum of %d patterns. With no FILE, read standard input. If fewer than two FILEs given, assume -h.Exit status is 0 if any matches, 1 if no matches, and 2 if trouble.pcregrep version %s using pcregrep: Unknown option -%c 3.0 14-Jan-2003PCRE version %s number %dpcregrep: Error while studying regex%s: %s pcregrep: Error in regex at offset %d: %s pcregrep: Error in regex number %d at offset %d: %s pcregrep: Too many patterns in file (max %d) pcregrep: malloc failed pcregrep: File name missing after -f file=pcregrep: Unknown option %s !#h#|#x#p#l#\00<0H0T0`0l0x00000000000000 0,080D0P0\0h0  4X h oc;o@oD` oo XPXcxhil 8nhxrsuV vHXxxx#dhX@`  4 H  0  X!"#X#`#h#l#p#xgo'#. t D , P  k"y#X#`#h  #|#x#p#l## H   #)"3TD 9"D#U | e#l  { H #L #### # l #d   +#\8#TF#lR#h`ut |! #!l4  X!  !$!%@!!0 !< !'% *#!2! 8 - ? G N!`V# ^#te!r # !8  !TH  !!!'" !x!H 0 %@!.libs/pcregrepcrti.svalues-Xa.ccrtstuff.c__do_global_dtors_auxframe_dummycall___do_global_dtors_auxforce_to_data__CTOR_LIST____DTOR_LIST____EH_FRAME_BEGIN__call_frame_dummyobject.2completed.1p.0__JCR_LIST__pcregrep.chints_listpattern_countisdirectoryopendirectorywhole_linesfilenamesusageoptionlistpattern_filenamegrep_or_recursesilentclosedirectorypcregreprecursehelppattern_listnumberinvertfilenames_onlyhandle_optioncount_onlyreaddirectorycrtstuff.c__DTOR_END____do_global_ctors_auxcall___do_global_ctors_aux__CTOR_END__force_to_data__JCR_END____FRAME_END__crtn.s_START__END__startstrlen__register_frame_info_environfwrite_fini_PROCEDURE_LINKAGE_TABLE_closedirreaddir_exitpcre_execmalloc__iobpcre_compilefprintffopen_initprintferrnostatenvironfgets_etextopendirmemcmpsprintf__ctype_edatapcre_version__deregister_frame_info_ctypemainatexitstrerror_lib_version_Jv_RegisterClasses_DYNAMICstrcmppcre_study_end__dso_handleexitputsfclose_GLOBAL_OFFSET_TABLE__iobas: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 @(#)SunOS 5.9 Generic May 2002as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.2as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.2as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.2as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 ld: Software Generation Utilities - Solaris Link Editors: 5.9-1.343 <Y4v. d 'd 2<AkU1`pƀ=b‚߂^+ۂ[{;KSXԀiq{(F\<A ` 0G lO m ߀ Pw j  Ҁ ,2 E ! 2% H e> zD E J N ӀO PU^0_Jnbo{w}~р *Hf>?UV̀\]^_&aEb\cqpyz{Ѐ}~0LbzȀ6Wr׀hʀ  $/.G/_5tBCDEՀFGHN2RI^_`yahiˀ 3iɀ,P"8Pe{€ـ112I3_4v5ɀ6Q݀":Nj 0 M ) > !P!!!^"9"S0"i2""Q"ւ"$Ѐ&e&&&'&!'>'>'*("V(?$Z (R@YDZD\D^ D_@(d[h@(s$H(t$c (@bDcDd($($i (@hDiDjDlDlDmDn(Do`DjdDrd(@ld($l($v (@uDvDw($($ ) @)@DDD DD D4D<D@D@D`DhDlDDDD D D.4D<D%LD)\D*|D+D!D"D!D8D2D4D5,D9@),@)6@)H@)U `)w `)@)@)@4)@)@)@@)$H)$E )@C* @C*@C*5@DDEDMDEDMDMDk(Dl8DrDDtDuDnDoDQDQDZDWD]D^D_Db@DcHDUPDvt*L@F*V@G*a@H*kO*x@P*@Q (*O*@P*@Q*@\*@\*@\@H*O*@P*@QPtt+ $|+ $T+@DDD +"$D+#$DDDDD(D4D@DtDDDDDDDDDD DD(D4+0@+B+Jt+f+n@+w$L+x$+@ +@DDDTDhDxDDDDDDDDD<DLDlDDD+$+$+@+@DDDD DDD D4DDDPD\DtDD$D%D'D%D'D'D/DUDVDWDVDW D](Db8DdLDehDelDbxDpDwDvDvDwDyD{D|DyD|DyDyD Dh(DiPDKlDYD1D9D1D1D9D7D;D<D<DBDC4DD@DEDDG`DEhDGlDGpDIxD>D@DND5D)D*DD$D4D@DHDPDlD|DDDDDDDDD D(D0+@+@+@+@,,,@H,)@{,4@{,?@{ ,Jg(d,S@1,\2l,i@; ltt,tgt,}@1,2,@; ,@1,2,@1,2,@; ,@|,@|00,$8,&#-&#-( #-@(!#-c&##-u&$"-&%#-&&#-&'#-&(#-&)#-&*#-&4".d.interp.hash.dynsym.dynstr.SUNW_version.rela.got.rela.bss.rela.plt.text.init.fini.rodata.got.plt.dynamic.data.ctors.dtors.eh_frame.jcr.data.rel.local.bss.symtab.strtab.comment.stab.index.stab.shstrtab.stab.indexstr.stabstrvalues-Xa.cXa ; O ; V=3.1 ; R=Sun WorkShop 6 update 1 C 5.2 Patch 109513-05 2001/06/04/on81-builds/on81_58shwpl3/usr/src/lib/libc/sparc; /opt/SUNWspro.40/SC6.1/bin/../WS6U1/bin/cc -xO3 -xarch=v8 -xspace -W0,-Lt -Xa -xildoff -errtags=yes -errwarn=%%all -erroff=E_EMPTY_TRANSLATION_UNIT -D_REENTRANT -Dsparc -Iinc -I../inc -DTEXT_DOMAIN='"SUNW_OST_OSLIB"' -I/on81-builds/on81_58shwpl3/proto/root_sparc/usr/include -c -o values-Xa.o ../port/gen/values-Xa.c -W0,-xppcregrep.c/usr2/SOURCES/S9/pcre-4.5/pcregrep.cgcc2_compiled.int:t(0,1)=r(0,1);-2147483648;2147483647;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,3);-2147483648;2147483647;unsigned int:t(0,4)=r(0,4);000000000000000000000000;000000000000037777777777;long unsigned int:t(0,5)=r(0,5);000000000000000000000000;000000000000037777777777;long long int:t(0,6)=@s64;r(0,6);001000000000000000000000;000777777777777777777777;long long unsigned int:t(0,7)=@s64;r(0,7);000000000000000000000000;001777777777777777777777;short int:t(0,8)=@s16;r(0,8);-32768;32767;short unsigned int:t(0,9)=@s16;r(0,9);0;65535;signed char:t(0,10)=@s8;r(0,10);-128;127;unsigned char:t(0,11)=@s8;r(0,11);0;255;__int128_t:t(0,12)=@s128;r(0,12);000000000000000000000000;0377777777777777777777777777777777;__uint128_t:t(0,13)=@s128;r(0,13);000000000000000000000000;0377777777777777777777777777777777;float:t(0,14)=r(0,1);4;0;double:t(0,15)=r(0,1);8;0;long double:t(0,16)=r(0,1);16;0;complex int:t(0,17)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,18)=R3;8;0;complex double:t(0,19)=R4;16;0;complex long double:t(0,20)=R5;32;0;__builtin_va_list:t(0,21)=*(0,22)=(0,22)_Bool:t(0,23)=@s8;-16;pcregrep.c/usr/include/ctype.h/usr/include/iso/ctype_iso.h/usr/include/sys/feature_tests.h/usr/include/sys/isa_defs.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdarg.h__gnuc_va_list:t(7,1)=(0,21)/usr/include/iso/stdio_iso.h/usr/include/sys/va_list.h__va_list:t(9,1)=(9,2)=*(0,22)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio_tag.h__FILE:t(10,1)=(10,2)=xs__FILE:/usr/include/stdio_impl.hssize_t:t(11,1)=(0,1)__FILE:T(10,2)=s16_cnt:(11,1),0,32;_ptr:(11,2)=*(0,11),32,32;_base:(11,2),64,32;_flag:(0,11),96,8;_file:(0,11),104,8;__orientation:(0,4),112,2;__ionolock:(0,4),114,1;__seekable:(0,4),115,1;__filler:(0,4),116,4;;__longlong_t:t(8,1)=(0,6)FILE:t(8,2)=(10,1)size_t:t(8,3)=(0,4)fpos_t:t(8,4)=(0,3)off_t:t(6,1)=(0,3)off64_t:t(6,2)=(8,1)fpos64_t:t(6,3)=(8,1)/usr/include/string.h/usr/include/iso/string_iso.h/usr/include/stdlib.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/iso/stdlib_iso.hdiv_t:t(15,1)=(15,2)=s8quot:(0,1),0,32;rem:(0,1),32,32;;ldiv_t:t(15,3)=(15,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;wchar_t:t(15,5)=(0,3)lldiv_t:t(14,1)=(14,2)=s16quot:(0,6),0,64;rem:(0,6),64,64;;uid_t:t(14,3)=(0,3)/usr/include/errno.h/usr/include/sys/errno.hconfig.hpcre.hpcre:t(19,1)=(19,2)=xsreal_pcre:pcre_extra:T(19,3)=s16flags:(0,5),0,32;study_data:(9,2),32,32;match_limit:(0,5),64,32;callout_data:(9,2),96,32;;pcre_extra:t(19,4)=(19,3)pcre_callout_block:T(19,5)=s40version:(0,1),0,32;callout_number:(0,1),32,32;offset_vector:(19,6)=*(0,1),64,32;subject:(19,7)=*(19,8)=k(0,2),96,32;subject_length:(0,1),128,32;start_match:(0,1),160,32;current_position:(0,1),192,32;capture_top:(0,1),224,32;capture_last:(0,1),256,32;callout_data:(9,2),288,32;;pcre_callout_block:t(19,9)=(19,5)BOOL:t(1,1)=(0,1)option_item:T(1,2)=s12one_char:(0,1),0,32;long_name:(19,7),32,32;help_text:(19,7),64,32;;option_item:t(1,3)=(1,2)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/sys/types.h/usr/include/sys/machtypes.h_label_t:T(21,1)=s8val:(21,2)=ar(21,3)=r(21,3);000000000000000000000000;000000000000037777777777;;0;1;(0,3),0,64;;label_t:t(21,4)=(21,1)lock_t:t(21,5)=(0,11)/usr/include/sys/int_types.hint8_t:t(22,1)=(0,2)int16_t:t(22,2)=(0,8)int32_t:t(22,3)=(0,1)int64_t:t(22,4)=(0,6)uint8_t:t(22,5)=(0,11)uint16_t:t(22,6)=(0,9)uint32_t:t(22,7)=(0,4)uint64_t:t(22,8)=(0,7)intmax_t:t(22,9)=(22,4)uintmax_t:t(22,10)=(22,8)intptr_t:t(22,11)=(0,1)uintptr_t:t(22,12)=(0,4)int_least8_t:t(22,13)=(0,2)int_least16_t:t(22,14)=(0,8)int_least32_t:t(22,15)=(0,1)int_least64_t:t(22,16)=(0,6)uint_least8_t:t(22,17)=(0,11)uint_least16_t:t(22,18)=(0,9)uint_least32_t:t(22,19)=(0,4)uint_least64_t:t(22,20)=(0,7)longlong_t:t(20,1)=(0,6)u_longlong_t:t(20,2)=(0,7)t_scalar_t:t(20,3)=(0,3)t_uscalar_t:t(20,4)=(0,5)uchar_t:t(20,5)=(0,11)ushort_t:t(20,6)=(0,9)uint_t:t(20,7)=(0,4)ulong_t:t(20,8)=(0,5)caddr_t:t(20,9)=(20,10)=*(0,2)daddr_t:t(20,11)=(0,3)cnt_t:t(20,12)=(0,8)ptrdiff_t:t(20,13)=(0,1)pfn_t:t(20,14)=(20,8)pgcnt_t:t(20,15)=(20,8)spgcnt_t:t(20,16)=(0,3)use_t:t(20,17)=(20,5)sysid_t:t(20,18)=(0,8)index_t:t(20,19)=(0,8)timeout_id_t:t(20,20)=(9,2)bufcall_id_t:t(20,21)=(9,2)ino_t:t(20,22)=(20,8)blkcnt_t:t(20,23)=(0,3)fsblkcnt_t:t(20,24)=(20,8)fsfilcnt_t:t(20,25)=(20,8)ino64_t:t(20,26)=(20,2)blkcnt64_t:t(20,27)=(20,1)fsblkcnt64_t:t(20,28)=(20,2)fsfilcnt64_t:t(20,29)=(20,2)blksize_t:t(20,30)=(0,3) :T(20,31)=eB_FALSE:0,B_TRUE:1,;boolean_t:t(20,32)=(20,31)pad64_t:t(20,33)=(22,4)upad64_t:t(20,34)=(22,8)offset_t:t(20,35)=(20,1)u_offset_t:t(20,36)=(20,2)len_t:t(20,37)=(20,2)diskaddr_t:t(20,38)=(20,1)lloff_t:t(20,39)=(20,40)=u8_f:(20,35),0,64;_p:(20,41)=s8_u:(22,3),0,32;_l:(22,3),32,32;;,0,64;;lldaddr_t:t(20,42)=(20,43)=u8_f:(20,38),0,64;_p:(20,44)=s8_u:(22,3),0,32;_l:(22,3),32,32;;,0,64;;k_fltset_t:t(20,45)=(20,7)id_t:t(20,46)=(0,3)useconds_t:t(20,47)=(20,7)suseconds_t:t(20,48)=(0,3)major_t:t(20,49)=(20,8)minor_t:t(20,50)=(20,8)pri_t:t(20,51)=(0,8)o_mode_t:t(20,52)=(20,6)o_dev_t:t(20,53)=(0,8)o_uid_t:t(20,54)=(20,6)o_gid_t:t(20,55)=(20,54)o_nlink_t:t(20,56)=(0,8)o_pid_t:t(20,57)=(0,8)o_ino_t:t(20,58)=(20,6)key_t:t(20,59)=(0,1)mode_t:t(20,60)=(20,8)gid_t:t(20,61)=(14,3)taskid_t:t(20,62)=(20,46)projid_t:t(20,63)=(20,46)pthread_t:t(20,64)=(20,7)pthread_key_t:t(20,65)=(20,7)_pthread_mutex:T(20,66)=s24__pthread_mutex_flags:(20,67)=s8__pthread_mutex_flag1:(22,6),0,16;__pthread_mutex_flag2:(22,5),16,8;__pthread_mutex_ceiling:(22,5),24,8;__pthread_mutex_type:(22,6),32,16;__pthread_mutex_magic:(22,6),48,16;;,0,64;__pthread_mutex_lock:(20,68)=u8__pthread_mutex_lock64:(20,69)=s8__pthread_mutex_pad:(20,70)=ar(21,3);0;7;(22,5),0,64;;,0,64;__pthread_mutex_lock32:(20,71)=s8__pthread_ownerpid:(22,7),0,32;__pthread_lockword:(22,7),32,32;;,0,64;__pthread_mutex_owner64:(20,34),0,64;;,64,64;__pthread_mutex_data:(20,34),128,64;;pthread_mutex_t:t(20,72)=(20,66)_pthread_cond:T(20,73)=s16__pthread_cond_flags:(20,74)=s8__pthread_cond_flag:(20,75)=ar(21,3);0;3;(22,5),0,32;__pthread_cond_type:(22,6),32,16;__pthread_cond_magic:(22,6),48,16;;,0,64;__pthread_cond_data:(20,34),64,64;;pthread_cond_t:t(20,76)=(20,73)_pthread_rwlock:T(20,77)=s64__pthread_rwlock_readers:(22,3),0,32;__pthread_rwlock_type:(22,6),32,16;__pthread_rwlock_magic:(22,6),48,16;__pthread_rwlock_mutex:(20,72),64,192;__pthread_rwlock_readercv:(20,76),256,128;__pthread_rwlock_writercv:(20,76),384,128;;pthread_rwlock_t:t(20,78)=(20,77)_pthread_attr:T(20,79)=s4__pthread_attrp:(9,2),0,32;;pthread_attr_t:t(20,80)=(20,79)_pthread_mutexattr:T(20,81)=s4__pthread_mutexattrp:(9,2),0,32;;pthread_mutexattr_t:t(20,82)=(20,81)_pthread_condattr:T(20,83)=s4__pthread_condattrp:(9,2),0,32;;pthread_condattr_t:t(20,84)=(20,83)_once:T(20,85)=s32__pthread_once_pad:(20,86)=ar(21,3);0;3;(20,34),0,256;;pthread_once_t:t(20,87)=(20,85)_pthread_rwlockattr:T(20,88)=s4__pthread_rwlockattrp:(9,2),0,32;;pthread_rwlockattr_t:t(20,89)=(20,88)dev_t:t(20,90)=(20,8)nlink_t:t(20,91)=(20,8)pid_t:t(20,92)=(0,3)time_t:t(20,93)=(0,3)clock_t:t(20,94)=(0,3)clockid_t:t(20,95)=(0,1)timer_t:t(20,96)=(0,1)unchar:t(20,97)=(0,11)ushort:t(20,98)=(0,9)uint:t(20,99)=(0,4)ulong:t(20,100)=(0,5)u_char:t(20,101)=(0,11)u_short:t(20,102)=(0,9)u_int:t(20,103)=(0,4)u_long:t(20,104)=(0,5)_quad:T(20,105)=s8val:(20,106)=ar(21,3);0;1;(0,1),0,64;;quad_t:t(20,107)=(20,105)quad:t(20,108)=(20,107)/usr/include/sys/select.h/usr/include/sys/time.htimeval:T(24,1)=s8tv_sec:(20,93),0,32;tv_usec:(20,48),32,32;;timezone:T(24,2)=s8tz_minuteswest:(0,1),0,32;tz_dsttime:(0,1),32,32;;/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/sys/types.hitimerval:T(24,3)=s16it_interval:(24,1),0,64;it_value:(24,1),64,64;;hrtime_t:t(24,4)=(20,1)/usr/include/time.h/usr/include/iso/time_iso.htm:T(27,1)=s36tm_sec:(0,1),0,32;tm_min:(0,1),32,32;tm_hour:(0,1),64,32;tm_mday:(0,1),96,32;tm_mon:(0,1),128,32;tm_year:(0,1),160,32;tm_wday:(0,1),192,32;tm_yday:(0,1),224,32;tm_isdst:(0,1),256,32;;/usr/include/sys/time_impl.htimespec:T(28,1)=s8tv_sec:(20,93),0,32;tv_nsec:(0,3),32,32;;timespec_t:t(28,2)=(28,1)timestruc_t:t(28,3)=(28,1)itimerspec:T(28,4)=s16it_interval:(28,1),0,64;it_value:(28,1),64,64;;itimerspec_t:t(28,5)=(28,4)sigval:T(26,1)=u4sival_int:(0,1),0,32;sival_ptr:(9,2),0,32;;sigevent:T(26,2)=s24sigev_notify:(0,1),0,32;sigev_signo:(0,1),32,32;sigev_value:(26,1),64,32;sigev_notify_function:(26,3)=*(26,4)=f(0,22),96,32;sigev_notify_attributes:(26,5)=*(20,80),128,32;__sigev_pad2:(0,1),160,32;;/usr/include/sys/select.hfd_mask:t(23,1)=(0,3)fds_mask:t(23,2)=(0,3)fd_set:T(23,3)=s128fds_bits:(23,4)=ar(21,3);0;31;(0,3),0,1024;;fd_set:t(23,5)=(23,3)/usr/include/sys/stat.hstat:T(30,1)=s136st_dev:(20,90),0,32;st_pad1:(30,2)=ar(21,3);0;2;(0,3),32,96;st_ino:(20,22),128,32;st_mode:(20,60),160,32;st_nlink:(20,91),192,32;st_uid:(14,3),224,32;st_gid:(20,61),256,32;st_rdev:(20,90),288,32;st_pad2:(21,2),320,64;st_size:(6,1),384,32;st_pad3:(0,3),416,32;st_atim:(28,3),448,64;st_mtim:(28,3),512,64;st_ctim:(28,3),576,64;st_blksize:(20,30),640,32;st_blocks:(20,23),672,32;st_fstype:(30,3)=ar(21,3);0;15;(0,2),704,128;st_pad4:(30,4)=ar(21,3);0;7;(0,3),832,256;;stat64:T(30,5)=s152st_dev:(20,90),0,32;st_pad1:(30,2),32,96;st_ino:(20,26),128,64;st_mode:(20,60),192,32;st_nlink:(20,91),224,32;st_uid:(14,3),256,32;st_gid:(20,61),288,32;st_rdev:(20,90),320,32;st_pad2:(21,2),352,64;st_size:(6,2),448,64;st_atim:(28,3),512,64;st_mtim:(28,3),576,64;st_ctim:(28,3),640,64;st_blksize:(20,30),704,32;st_blocks:(20,27),768,64;st_fstype:(30,3),832,128;st_pad4:(30,4),960,256;;/usr/include/sys/stat_impl.h/usr/include/dirent.h/usr/include/sys/dirent.hdirent:T(33,1)=s12d_ino:(20,22),0,32;d_off:(6,1),32,32;d_reclen:(0,9),64,16;d_name:(33,2)=ar(21,3);0;0;(0,2),80,8;;dirent_t:t(33,3)=(33,1)dirent64:T(33,4)=s24d_ino:(20,26),0,64;d_off:(6,2),64,64;d_reclen:(0,9),128,16;d_name:(33,2),144,8;;dirent64_t:t(33,5)=(33,4)DIR:t(32,1)=(32,2)=s16dd_fd:(0,1),0,32;dd_loc:(0,1),32,32;dd_size:(0,1),64,32;dd_buf:(20,10),96,32;;directory_type:t(1,4)=(32,1)isdirectory:f(0,1)filename:P(20,10)statbuf:(30,1)opendirectory:f(1,5)=*(1,4)filename:P(20,10)readdirectory:f(20,10)dir:P(1,5)dent:r(1,6)=*(33,1)closedirectory:f(0,22)dir:P(1,5)pcregrep:f(0,1)in:P(1,7)=*(8,2)name:P(20,10)rc:r(0,1)linenumber:r(0,1)count:r(0,1)offsets:(1,8)=ar(21,3);0;98;(0,1)buffer:(1,9)=ar(21,3);0;1023;(0,2)match:r(1,1)i:r(0,1)length:r(0,1)match:r(1,1)i:r(0,1)length:r(0,1)grep_or_recurse:f(0,1)filename:P(20,10)dir_recurse:P(1,1)show_filenames:P(1,1)only_one_at_top:P(1,1)rc:r(0,1)sep:r(0,1)in:r(1,7)buffer:(1,9)nextfile:r(20,10)dir:r(1,5)buffer:(1,9)nextfile:r(20,10)dir:r(1,5)frc:r(0,1)frc:r(0,1)frc:r(0,1)buffer:(1,9)nextfile:r(20,10)dir:r(1,5)usage:f(0,1)rc:P(0,1)help:f(0,22)op:r(1,10)=*(1,3)n:(0,1)s:(1,11)=ar(21,3);0;3;(0,2)n:(0,1)s:(1,11)handle_option:f(0,1)letter:P(0,1)options:P(0,1)main:F(0,1)argc:P(0,1)argv:P(1,12)=*(20,10)i:r(0,1)j:r(0,1)rc:r(0,1)options:r(0,1)errptr:(0,1)error:(19,7)s:r(20,10)frc:r(0,1)frc:r(0,1)frc:r(0,1)s:(30,3)f:r(1,7)buffer:(1,9)s:r(20,10)s:(30,3)f:r(1,7)buffer:(1,9)s:r(20,10)f:r(1,7)buffer:(1,9)f:r(1,7)buffer:(1,9)s:r(20,10)s:r(20,10)op:r(1,10)pattern_filename:S(20,10)pattern_count:S(0,1)pattern_list:S(1,13)=*(1,14)=*(19,1)hints_list:S(1,15)=*(1,16)=*(19,4)count_only:S(1,1)filenames:S(1,1)filenames_only:S(1,1)invert:S(1,1)number:S(1,1)recurse:S(1,1)silent:S(1,1)whole_lines:S(1,1)optionlist:S(1,17)=ar(21,3);0;13;(1,3)  hh"XXo@@ -B``$  7B0 ABD K QW44]HHe 0 0(j X Xx o!!x""~#X#X#`#`#h#h#l#l#p#p#x#x#tQ +d /Y1$ 2  OPRg.0707010004d7ca000081a40000000a0000000a00000001402cbcbf00010e240000008800000005000000000000000000000013ff350889reloc/bin/pcretestELF 4 L4 (44XXXXZZ/usr/lib/ld.so.1CB !"#$%&')*,.34567;>  (+-/01289:<=?@A  +Z5YCYIY\P h_@nZdsYtzY]t]  t ZZ4Z]Z(a$X YI  Y&]3a,8Z@KY8QZ^ZcZlXYPZpYZ]!ZLa YhYZ|] !YX a(XY%Z5YD=ZFYNXSZ[I h]qYvI |_@!Y[ (L ZZXZ_Jv_RegisterClasses__register_frame_infopcre_execpcre_fullinfo_exitfwrite__deregister_frame_info__iob.divprintfregfree_edata__ctype_startpcre_infopcre_free_substring_listtolowerpcre_stack_mallocpcre_get_substring_listpcre_stack_free_GLOBAL_OFFSET_TABLE_fflush_initfgetspcre_callout_endpcre_get_substringfputcpcre_compileputs_DYNAMIC_PROCEDURE_LINKAGE_TABLE_.umulclockstrlenpcre_configenvironpcre_free_substringpcre_mallocfputspcre_versionpcre_get_stringnumber_ctypesetlocale_etextpcre_freeatexitfopenpcre_maketablesfprintfregerrorregcompexitregexec_lib_version_environfree_fini_iobmalloc__dso_handlemainmemcmppcre_copy_substringpcre_studylibc.so.1SYSVABI_1.3libpcre.so.0libpcreposix.so.0libc.so.1/usr/local/lib7̳XXX]a(.]a$a ']8_] X/X5YYY Y,Y8YD2YP!Y\Yh(Yt Y<Y9YY0Y)YYY,Y Y#Y4Z6Z3ZZ(Z4Z@ZL&ZX@Zd Zp"Z|*ZZZZAZ1Z?ZZ$ @D# @SR!@R@', @ "@@R@R㿐/RD#`  @  `@@`" `@$@```$``@R`  +㿐㿐/Rή`  ``@R ``` `@R㿐㿐@ ` ?a `W @R ) S@R`($ Rc@ R. c@  @@ +   @ `? (@  S`(@Rw S`0㿐  @Rp'S /F0`  `+&@Ra8``K    *S`@@RP`  *S`P@RE(`8@ ` (`@S1S``@R3  h@R6 C ` (` @S`@R&-К` @ @R& 8@R a&  a S`W`S`@Q  S@Q ? @Q {` ,@Qޒ  *S@Qْ`-`В@Qΐ ? a S`W`S`@QÐ` (`@@Qƒ a S`W`Sa@Q`% ,@Q  *S@Q`-ɀ`$S   @Q`%(   ` (`@@QܔŢ ` (`@S@Q~a`.S ! @Q{  *S@Qm`-`-S !  @Qi `9 "< a;S>0`8` ;@ `")->0`8` ;@ `->-]`?`?  \`W@Q(aσ> `9"= `S`8a(Sa0S-@Qa8 `/&`4#`64    +`(`@ @ 2SS@PaH `6 ? `$@ @P @Pa@ +`` @ @P Ġ 0    @P̐ -   -@P’-]`?`?  \`W@P`(@P@P`(@P}@Pr   `+`0`@ `;  ^@P7  *S@PaP-@ t ` (` @SUaX  +` ` @ * SIah  (`?@ c ` (`@S  @Pb!p7 ` (`@S[a  +` ` @ *`S@ @PS!h"T8xxx```444`<```````````㿐` `7@`` ``"`@`2 `@`"# .@@ @@#R a؃* * 8 ?@   ?`*@: *Ra@ `*@ 㿐? 4`?`?@/ .Rb@@ @/ 8  ?`.@R a؃..8##  㿈` ?#aa`  `W '쀦" @OB `0'S@O9`( 쀢 `&@` `Wݐ Sa@Oؠ㿐-)!@ '!`2l S ! @O  "@ "@ @N !`"AS  @N @N֐ ?@Nѐ ^` `ᘠ@NȐ ?@NÐ ^@N $% 2a@ K a`@ C"A S@Na;S@N`8Ā  S@Na @/S+S, @4 a :`4 @N @ `"@ #  @Nw @&l @Nn: 㿐@Nva` aaS@NXa㿐a`@N`aS@NIb0㿐@NTa` aSb(@N8㿐a`@N@aS@N)b@0㿐@N6 a3S@NbX㼘!@N!!0'H@N!0- -c'D't`  %'l'h'd'`'T'P'L`H@`-I `+ '\@N 'X 4,  ,@`S@Mb $%GcG#! cH`,#!(H#!Ț`t@M a$S@Mɒbt#ac'@  '< P'8'4h'0Ht@Mђa0  t@@MH@MH a@ `H` @ @ `2` L`tt#@ @M  ! \`@ `?@`a03S ``H`\"  `@`  ```\H$ %@ Btc@9t@Mt  t@MW S "@ML T ''L`@ @MJ <@ME<`"L@M? S @MMbL@ML@@M-btS "@M ,T't#@!aHt@M(!0  @M/H H @  Ѩ?  H@ @ 2? H@L 'LH `\",,d' $ `'p`n (`Qc@ '4 `T@'X',p   p`2@L ;H#!#aG a #a  a?Ђb?#! at'#D@X`'( '$ ' ' ''pHt@La0 D t@@LH@LH Ha @ `H ? H @ 2?H #+@H@a @ `H` @ @ `2` D ` \  `.@ @` .@D,`]&@   @LF-p 2 pa2 D@LW 9H @"0;S9S@ ,``a@LD"@@L `?@ `@ ,`@LL  @K"D%@@K `0@LHS@Kc0lp`z $`O(  @E?`&@&#\#`@K?'?`@0`@ 8`S@Kc &  ͠ $%S, `S4  a@K:@`"@:@@K 2 0` ,  %S#S?@`sȠ  ?@ %S#S?`Q|  ? `48 @  '4 "%  `y'@ @$'@Kx # x#Sx, @ @K?c xx, `@Ko4S #@K2 #xS@K'c4@K_  |c@K@KY|  p@K @KL  c`@K  @@J{   S@J"%@@J a 4 S a@J:X  $a `6h$ @ ```@ @  & @ U$? Sc@J`2T   @J  !T@J @J  `0`@ 8` @J " @`&& #\#`@Jł@J "@#\#`@J@Jp0cO@ `@#\#`@J?@@J"'V `VV` J T`@ ʑ ?@J:_$ @ x* Qa@ ` @`?Кaр   @ ` 8 9* `@ p @'pp @`'pp @ @ a @ ``` @, @@@ @ Ђ `(@@`+ؘ+` @ @ ` +@@J*   @(@@T@IВ`` @j`-d`!)`*`'  -  @ `  `+`@ @@' @ @ ` @I' @ '( @?` a @ @ `" a`+`@ @@ #! @ @ ` #a @ !>`  a @ `U a`+`@ @@ #! @ @ `#``=#a `8#! @ a @ `` ` @, @@@ @ Ђ `(@` ؘ+` @ @ ` +@@I _  @(@ @ ' @ '$p @d @ a @ `"\ ` @, @@@ @ \ 4X ¤` @I, '\@I 'X @T @I   #ap @a       @`{%` @!H@   * @I  @! @ А    aH@ `s* o ` aH@  ` `}2 @ݒؘ ?   .@`  N  * @H @`?А?  H@`* ـ`}H- T@H H0@HHT`@HoYtl`p<@H '@ᔀ`@ ` 2@  ,@  '@  "@  @  @  @  @   @  @@H} T@H` T@Ha T@H aPa T@HaT@GaT@Ga`)aT "@G `'!S#T@H    +`"@ !0@GՒb0 @ ?''`3T`b@!S!0T`bP!S!0T`b`!S!0T`bp!S!0T`b!S!0#\` Tb!S!0#``@Tb!S!0#dbTb!S!0#hhTb!S!0#lT@b!S!0T#p@Gb@ @Հʀ!S !0Tba `WTb@GeS a0Tb! `WTc@GQ`l`i@@G ^ U@ '@  `T #( T #H@G+  aѠ %T)T+T< 0`8` @(`$; " `K  `W@ @ @#p`@G  @F Hcx`h  @F  T #= T,c@G,0cO`@ @G3?@G"@F'V `VV` J Tc ʑ ?@Fs@TgcT  @F#b`THcU   @FBU   "U  H@F U  @F `@U@F`p S C@F h@+@`@F`a" U@Fs`U`@F0cO`p<@F '@@Fl?2p@F"'V `VV` J U`ؑ ʑ ?@FBp r'0p h#!k'ppf'pp`b'p _ p  Y'8W  ` ` @ @   ` ` @ @ 2, @F- T@Fa7'<U'`@Et *$& $ pbp`@p p`p` ?T@U'ޒap  `d `e U !0@EΔ )T'H*@U@Eː!`H`UÐ!h@U@E͒a 't@)U@!@F     Ua@F  U 'd? ,@K@`-"@`a@E  U 'la@E  U 'ha@Eؔ   'P'hU @E͒a 2@ p@Ua@E   'TUa@E  U@E]!U@E!U@E"@U@E"xU@E#U@E#(U @EYU@EF#xU@E#@E S`a0UcU@E6# @EU` cUcU@E)#В@E U@E"#@Ey V@E @Er V@E 0 @EkV``PV`XV@E `@D `'`@`2@R?0000000000000000000000000000000000000000000000000000000000000001011,1<0003000044440005|0000005000000050055000000050005050505&AAAAAAAAAAAAAAAAAAAAA&AAAAAAAAAA@LAAAAAAAAAAAA@XAAAAAA@tA@AA@@A@A@AA@AlAxAAAAAAAAAAAAAAAAAAAAAAAA&AAAAAAAAAAAAAAAAA㿐/CH`@?㿐㿠㿠End\A\G\B\b\D\d\S\s\W\wAnyAnybyte\Z\zOpt^$charsnot**?++????{classnclassxclassRefRecurseCalloutAltKetKetRmaxKetRminAssertAssert notAssertBAssertB notReverseOnceCondCond refBrazeroBraminzeroBranumberBra\x%02x\x{%x}%3d %3d Bra extra %3d Bra %d %s ------------------------------------------------------------------ %.2x %s [^%c] [^\x%02x] %d} [^%c]{ [^\x%02x]{ %s{0, [ (neg)]%s{%d,%d}{%d,} \%d %s %d%3d %s Cond recurse %s\x{%02x}%n--->Callout data = %d Callout %d: last capture = %d %2d: %2d: malloc %3d %p free %p stack_malloc %3d %p stack_free %p Error %d from pcre_fullinfo(%d) wPCRE version %s > ** Unexpected EOF C** Expression too long - missing delimiter? 0+ No match: POSIX code %d: %s Minimum match limit = %d copy substring %d failed %d %2dC %s (%d) get substring %d failed %d %2dG %s (%d) %2dL %s string list not terminated by NULL get substring list failed %d Error %d No match Matched, but too many substrings Execute time %.3f milliseconds no parentheses with name "%s" ** Failed to get %d bytes of memory for offsets vector data> Failed: POSIX code %d: %s Count disagreement: pcre_fullinfo=%d pcre_info=%d First char disagreement: pcre_fullinfo=%d pcre_info=%d Options disagreement: pcre_fullinfo=%ld pcre_info=%d Size disagreement: pcre_fullinfo=%d call to malloc for %d Capturing subpattern count = %d Max back reference = %d Named capturing subpatterns: %s %*s%3d anchored caseless extended multiline dotall dollar_endonly extra ungreedy utf8 no_utf8_checkOptions:%s%s%s%s%s%s%s%s%s%s (caseless)First char = '%c'%s Need char = '%c'%s No starting character set Starting character set: %c \x%02x Study returned NULL Failed to study: %s Study time %.3f milliseconds Need char = %d%s No need char First char = %d%s No first char First char at start or follows \n Case state changes No options Error %d from pcre_info() Memory allocation (code space): %d Failed: %s at offset %d Compile time %.3f milliseconds ** Failed to set locale "%s" ** Unknown option '%c' ** Delimiter must not be alphameric or \ re> ** Failed to open %s r-s-m-t-i-d-o-p-C** Unknown or malformed option %s Usage: pcretest [-d] [-i] [-o ] [-p] [-s] [-t] [ []] -C show PCRE compile-time options and exit -d debug: show compiled code; implies -i -i show information about compiled pattern -o set size of offsets vector to -p use POSIX interface -s output store information -t time compilation and executionPCRE version %s Compiled withNo %sUTF-8 support CRLF Newline character is %s Internal link size = %d POSIX malloc threshold = %d Default match limit = %d stackheap Match recursion uses %s @@@jA.Z]h]|]x]p]l]\00<0H0T0`0l0x00000000000000 0,080D0P0\0h0t0000000000000~0{0x I I$  o(o 4o  T| ooX!!J J(J0J8J@JHJPJXJ`JhJpJxJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJKKKKK K(K0K8K@KHKPK`KhKxKKKKKKK]d$ 4 T x   I I I X XZ[]X]`]h]l]p]xa,#. L D P  k[y]X]`]h ]|]x]p]l  ] H  ,H ],]8]K S ^8 g n[My]h ]]\ 4P  K K@  I I J ] ]]# t8 .9]dFIH \I w]\]T]l]h  ZYY Y\ (_@.Zd3Yt:YB]tI] Q t XZbZ4{Z]Z(a$X YI Y]a,Z@ Y8ZZ#Z,XFYPLZpRYYZe]!mZLa YhYZ|] !YX a(XYZYDZYXZI (]1Y6I <_@!AYH[U (L ZZaZXuZ.libs/pcretestcrti.svalues-Xa.ccrtstuff.c__do_global_dtors_auxframe_dummycall___do_global_dtors_auxforce_to_data__CTOR_LIST____DTOR_LIST____EH_FRAME_BEGIN__call_frame_dummyobject.2completed.1p.0__JCR_LIST__pcretest.cprint_internalscallout_countnew_infostack_malloccallout_extrashow_malloccallout_fail_countcalloutprint_charnew_freepcharsOP_lengthsgotten_storeget_valueuse_utf8outfileOP_namesnew_mallocutf82ordutf8_t3utf8_t4ord2utf8utf8_table1utf8_table2utf8_table3first_calloutcallout_fail_idlog_storestack_freecrtstuff.c__DTOR_END____do_global_ctors_auxcall___do_global_ctors_aux__CTOR_END__force_to_data__JCR_END____FRAME_END__crtn.s_START__END__Jv_RegisterClasses__register_frame_infopcre_execpcre_fullinfo_exitfwrite__deregister_frame_info__iob.divprintfregfree_edata__ctype_startpcre_infopcre_free_substring_listtolowerpcre_stack_mallocpcre_get_substring_listpcre_stack_free_GLOBAL_OFFSET_TABLE_fflush_initfgetspcre_callout_endpcre_get_substringfputcpcre_compileputs_DYNAMIC_PROCEDURE_LINKAGE_TABLE_.umulclockstrlenpcre_configenvironpcre_free_substringpcre_mallocfputspcre_versionpcre_get_stringnumber_ctypesetlocale_etextpcre_freeatexitfopenpcre_maketablesfprintfregerrorregcompexitregexec_lib_version_environfree_fini_iobmalloc__dso_handlemainmemcmppcre_copy_substringpcre_studyas: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 @(#)SunOS 5.9 Generic May 2002as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.2as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.2as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.2as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 ld: Software Generation Utilities - Solaris Link Editors: 5.9-1.343 <Y4F d'd2<AkU1`pƀ=b‚߂^+ۂ[{;KSXԀiq{(F\<A ` 0G lO ڂ j! % > ɀD ߀E J N "O 9P PU g^ _ n o ʀw } ~ = [ y > ΀? U V \ 3] J^ __ ua b c p ـy z{}5~Lcɀ2Olـ &<W 4H c$~./5ÀB܀CD E$F=GTHlNR^`Ȁahi?`<\`؀={ Kqʀ(>Rh1234ŀ560Jb,q0̀2$Q:V9v)>P J % ; Y"]"z""""#-#K#i##E#Ȁ+#$9U$O$$m$%+w%E&y&&'P+++,-,׀-F5-f.F./N/#/׀Z/2223B3F4K4V4a$?4s@> 4@>4@>4D?DBD?DB DD$DEDDJ`DLlDK|DLDKDLDMDPDODPDMDPDMDMDRDSDU4@@ 4@I 4@J4@K $4@I 4@J4@K `4$4$`5@_5@_D`DbDb DeDbDe Db$De(Dd,De0Dg4Dm4DoDDkHDoHDq\DrlDuDvDtDyD|D}D|D}D|D|D}DD0Dc8DdDDcHDdLDdPDgXD`DdDtDxD|D|DDDDDDDDD DD D$D,DDDdDD`DDDDDDD D$DDDTDlDDDDDD$D<D@DDDPD\DlDDDDDD D,D)<D.@D>PDCDQDRDQDRDQDSDUDVDWDT DK DL4D1<D3HD4XD3\D4`D6D7D"D#D$D DDHD PDTD XD\D `D dDDDDDD D0D@D_`DD5'@b5:@d5H@e5U@i5d@j 5m@k45z@`5@5@5@5@ 5@ 5@$5@,5@0HP5@0<5@D6$ 6$ch6@b6$@b6:hDcDeDcDe DdDeDf\DgDi6E@d6S$6T$6d@6r@ DDD D D8D@DLDPDTD\D`DdDhDlDpDtD|DDD6@ 6@ 6$6$6@6@ DDD DDDDD(D,D8DDD`DpDtDxD|DDDDDDDDDDDDDDDDDD6@6@6@6@6@6$6$6@7@7@DDDD D D0DHD\DpDDDDDDDDDDDDD77&@73@(07=@7G7O7W$7X$7g@ DDDDD,D)<D+\D,lD+tD,xD/D,D/D2D7D:D;D=D?D@@DCHDFTDFXDHdDIhDPtDKDLD8DDDD@DHD lDxDDR7y@7@7@7@7@Hdt7@H7$7$]7@\D]D^D` D]D_D^D` D`,Da4DbH7@^ $8@^ (H8$P8$f8"@e DfDgDg DiDh 8/$880$p ,8D@oDpDqDr DpDrDrDs$Dt@8P@q@8]$H8^$x t8q@w DxDyDy D{Dz 8~$88$ 8@8@ 8@ 8@ DDD(D<8@<8$H8$ 8@8@DDDDD D$D(D,D0D4D8D<D@DDDHDLDPDTDXD\D`D`D|DDDDDDDD D D DDDDDDDDD DDD4D54D38D5<D3@D5DD HD5LD!PD%TD*XD+\D,`D-dD.hD/lD0pD5pD6xD7D8D;D;D<DD(DC@DC\DKlDIpDKtDM|DODPDQDUDVD\D]Dc DK D_(Da@D`DDaHD`LDPDPD`DxDDDDXDYDDD D<DDDDDDDaDDSDjDnDtDnDtDvDrDvDxDzD$D4DLDPD`DpDDDDDDDDDDDDDDDDDDDDDDDDDD DDDDDD$DDD\DdDDDDDDD DDD D$D(D0DLDPDTDXDXDdDdDhDlDtDDDDDDDDD D(D4DHDXDhDxDDDDDDDDD D D D D D D D @D LD XD dD hD xD D D D' D* D, D0 D1 D3 D4 D6 D* 0DA @DC LDA \DO lDQ xDO Da D D D D D D D D Dd Df Dj ,Dk @Dj \Dl lDo Dm Dg DT DV DZ D\ DW DF DH <DK HDI `D8 |D9 D; D- D} D D D D D D D D D TD \D hD |D D! D" D D D DD$D ,D 8D@DDDHDLDPDTDXDxD|DDDDDDDDDDDD(DDDDDDDDD DDD$D(D,Dv0D!8D"<D!@D%HD'hD(D*D-D.D/D0D1D3D2D5 D:(D?0DM8DP@DQDDOLDQLDRXDStDTDWDUDWDADBDADCDDDE4DF<DILDI`DJpD<D=D=D7D8D8DZD\D],D_@DcHDbLDcTDdtDexDfDgDjDhDjDnDmDnDrDqDrDuDvDuDyDz D0D<D}DD|LD~PDXD\D lDlDDDDDDDDDDDDDDDDDDD@DtD|D|DDDDDDD D DD\DpDDDDDDDD D D $D 8D LD`DtDDDDDDDD D%(D)LD*`D+pD-|D/D0D2D5D9(D:8DFTDIlDM|DTDSDTDVDWD\DcDbDcDeDfDoDq D0D<D@DLDXD`DpDxDDDDDDDDDDDDLDPDPDXDdDxDDDDDDuDvDuDvDwDvDvDxDyDy DzDhlD^xDYDODKDGD4DHD\DDDDDDDDDDDXDdDDDDDDDDD $D (D @D HD HD PD TD XD `D dD pD xD D D D D D{ D| D} D D D D D D D D~ DE! DF!8D !dD!tD!D!D!D!D!D!D"D"@D"hD"D"D"D#D#D# D#,D#8D#DD#PD#XD#pD#|D#D#D#D#D#D$D$ D$D$(D$8D$DD$lD$D$D$9t9p9@9'l94h9Cd9S`9f\9}X9T9P9L9H9D9̀ @9@!9$9@%9(: @):@):!@):-*<:;@+:K@,:[-8:f.4:q@/:00:1:@1@: @:@!:ʀ$:@%:(:@):@);@);*<;"@+;2@,;B-8;M.4;X@/;k00;}1;@1@;@;@ P;@;@;@;@;<(<@<,@<5@@F X>E>"@F ` t >,@ >;@  H>E@ L T \>O@>Z@>e@ ,>p@>y@>@x>@>@x>,>@-  >@O D>a>@b L?@|??0@ ?:@\\p?E@?O@ p?]?o??@ ???Ā?Հ??@ @@&@S @0@T |@A@b @K@c @\@g`@z@@@@@@@@@s@@t@@ud@π@@A@ AA%A6AGAWAkA{AlA@b A@c lxAAŀAڀA@ AB BB+B;BOB_BqB|@S B@T \B@B@B@P!dBȀ!!Bր!!B"#PB @B@!C $C@%C%(C2@)C<@)CG@)CS*<Ca@+Cq@,C-8C.4C@/C00C1C@1#PC@C@C@D@DD/(DF@DS@D\@Do$D@D DD@Dɀ#PD@D@#P#X#X#XD#XD#X$t$$E$(LE(,]E&-]E%(.]E:(/]EO(0]Ei(1]E(2]E(3]E(4]E(5]E&8IE&;IF#&>JFK&L[Fs&*\ F&5KF&7KFdI@.interp.hash.dynsym.dynstr.SUNW_version.rela.got.rela.bss.rela.plt.text.init.fini.rodata.got.plt.dynamic.data.ctors.dtors.eh_frame.jcr.data.rel.local.bss.symtab.strtab.comment.stab.index.stab.shstrtab.stab.indexstr.stabstrvalues-Xa.cXa ; O ; V=3.1 ; R=Sun WorkShop 6 update 1 C 5.2 Patch 109513-05 2001/06/04/on81-builds/on81_58shwpl3/usr/src/lib/libc/sparc; /opt/SUNWspro.40/SC6.1/bin/../WS6U1/bin/cc -xO3 -xarch=v8 -xspace -W0,-Lt -Xa -xildoff -errtags=yes -errwarn=%%all -erroff=E_EMPTY_TRANSLATION_UNIT -D_REENTRANT -Dsparc -Iinc -I../inc -DTEXT_DOMAIN='"SUNW_OST_OSLIB"' -I/on81-builds/on81_58shwpl3/proto/root_sparc/usr/include -c -o values-Xa.o ../port/gen/values-Xa.c -W0,-xppcretest.c/usr2/SOURCES/S9/pcre-4.5/pcretest.cgcc2_compiled.int:t(0,1)=r(0,1);-2147483648;2147483647;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,3);-2147483648;2147483647;unsigned int:t(0,4)=r(0,4);000000000000000000000000;000000000000037777777777;long unsigned int:t(0,5)=r(0,5);000000000000000000000000;000000000000037777777777;long long int:t(0,6)=@s64;r(0,6);001000000000000000000000;000777777777777777777777;long long unsigned int:t(0,7)=@s64;r(0,7);000000000000000000000000;001777777777777777777777;short int:t(0,8)=@s16;r(0,8);-32768;32767;short unsigned int:t(0,9)=@s16;r(0,9);0;65535;signed char:t(0,10)=@s8;r(0,10);-128;127;unsigned char:t(0,11)=@s8;r(0,11);0;255;__int128_t:t(0,12)=@s128;r(0,12);000000000000000000000000;0377777777777777777777777777777777;__uint128_t:t(0,13)=@s128;r(0,13);000000000000000000000000;0377777777777777777777777777777777;float:t(0,14)=r(0,1);4;0;double:t(0,15)=r(0,1);8;0;long double:t(0,16)=r(0,1);16;0;complex int:t(0,17)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,18)=R3;8;0;complex double:t(0,19)=R4;16;0;complex long double:t(0,20)=R5;32;0;__builtin_va_list:t(0,21)=*(0,22)=(0,22)_Bool:t(0,23)=@s8;-16;pcretest.c/usr/include/ctype.h/usr/include/iso/ctype_iso.h/usr/include/sys/feature_tests.h/usr/include/sys/isa_defs.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdarg.h__gnuc_va_list:t(7,1)=(0,21)/usr/include/iso/stdio_iso.h/usr/include/sys/va_list.h__va_list:t(9,1)=(9,2)=*(0,22)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio_tag.h__FILE:t(10,1)=(10,2)=xs__FILE:/usr/include/stdio_impl.hssize_t:t(11,1)=(0,1)__FILE:T(10,2)=s16_cnt:(11,1),0,32;_ptr:(11,2)=*(0,11),32,32;_base:(11,2),64,32;_flag:(0,11),96,8;_file:(0,11),104,8;__orientation:(0,4),112,2;__ionolock:(0,4),114,1;__seekable:(0,4),115,1;__filler:(0,4),116,4;;__longlong_t:t(8,1)=(0,6)FILE:t(8,2)=(10,1)size_t:t(8,3)=(0,4)fpos_t:t(8,4)=(0,3)off_t:t(6,1)=(0,3)off64_t:t(6,2)=(8,1)fpos64_t:t(6,3)=(8,1)/usr/include/string.h/usr/include/iso/string_iso.h/usr/include/stdlib.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/iso/stdlib_iso.hdiv_t:t(15,1)=(15,2)=s8quot:(0,1),0,32;rem:(0,1),32,32;;ldiv_t:t(15,3)=(15,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;wchar_t:t(15,5)=(0,3)lldiv_t:t(14,1)=(14,2)=s16quot:(0,6),0,64;rem:(0,6),64,64;;uid_t:t(14,3)=(0,3)/usr/include/time.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/sys/types.h/usr/include/sys/machtypes.h_label_t:T(18,1)=s8val:(18,2)=ar(18,3)=r(18,3);000000000000000000000000;000000000000037777777777;;0;1;(0,3),0,64;;label_t:t(18,4)=(18,1)lock_t:t(18,5)=(0,11)/usr/include/sys/int_types.hint8_t:t(19,1)=(0,2)int16_t:t(19,2)=(0,8)int32_t:t(19,3)=(0,1)int64_t:t(19,4)=(0,6)uint8_t:t(19,5)=(0,11)uint16_t:t(19,6)=(0,9)uint32_t:t(19,7)=(0,4)uint64_t:t(19,8)=(0,7)intmax_t:t(19,9)=(19,4)uintmax_t:t(19,10)=(19,8)intptr_t:t(19,11)=(0,1)uintptr_t:t(19,12)=(0,4)int_least8_t:t(19,13)=(0,2)int_least16_t:t(19,14)=(0,8)int_least32_t:t(19,15)=(0,1)int_least64_t:t(19,16)=(0,6)uint_least8_t:t(19,17)=(0,11)uint_least16_t:t(19,18)=(0,9)uint_least32_t:t(19,19)=(0,4)uint_least64_t:t(19,20)=(0,7)longlong_t:t(17,1)=(0,6)u_longlong_t:t(17,2)=(0,7)t_scalar_t:t(17,3)=(0,3)t_uscalar_t:t(17,4)=(0,5)uchar_t:t(17,5)=(0,11)ushort_t:t(17,6)=(0,9)uint_t:t(17,7)=(0,4)ulong_t:t(17,8)=(0,5)caddr_t:t(17,9)=(17,10)=*(0,2)daddr_t:t(17,11)=(0,3)cnt_t:t(17,12)=(0,8)ptrdiff_t:t(17,13)=(0,1)pfn_t:t(17,14)=(17,8)pgcnt_t:t(17,15)=(17,8)spgcnt_t:t(17,16)=(0,3)use_t:t(17,17)=(17,5)sysid_t:t(17,18)=(0,8)index_t:t(17,19)=(0,8)timeout_id_t:t(17,20)=(9,2)bufcall_id_t:t(17,21)=(9,2)ino_t:t(17,22)=(17,8)blkcnt_t:t(17,23)=(0,3)fsblkcnt_t:t(17,24)=(17,8)fsfilcnt_t:t(17,25)=(17,8)ino64_t:t(17,26)=(17,2)blkcnt64_t:t(17,27)=(17,1)fsblkcnt64_t:t(17,28)=(17,2)fsfilcnt64_t:t(17,29)=(17,2)blksize_t:t(17,30)=(0,3) :T(17,31)=eB_FALSE:0,B_TRUE:1,;boolean_t:t(17,32)=(17,31)pad64_t:t(17,33)=(19,4)upad64_t:t(17,34)=(19,8)offset_t:t(17,35)=(17,1)u_offset_t:t(17,36)=(17,2)len_t:t(17,37)=(17,2)diskaddr_t:t(17,38)=(17,1)lloff_t:t(17,39)=(17,40)=u8_f:(17,35),0,64;_p:(17,41)=s8_u:(19,3),0,32;_l:(19,3),32,32;;,0,64;;lldaddr_t:t(17,42)=(17,43)=u8_f:(17,38),0,64;_p:(17,44)=s8_u:(19,3),0,32;_l:(19,3),32,32;;,0,64;;k_fltset_t:t(17,45)=(17,7)id_t:t(17,46)=(0,3)useconds_t:t(17,47)=(17,7)suseconds_t:t(17,48)=(0,3)major_t:t(17,49)=(17,8)minor_t:t(17,50)=(17,8)pri_t:t(17,51)=(0,8)o_mode_t:t(17,52)=(17,6)o_dev_t:t(17,53)=(0,8)o_uid_t:t(17,54)=(17,6)o_gid_t:t(17,55)=(17,54)o_nlink_t:t(17,56)=(0,8)o_pid_t:t(17,57)=(0,8)o_ino_t:t(17,58)=(17,6)key_t:t(17,59)=(0,1)mode_t:t(17,60)=(17,8)gid_t:t(17,61)=(14,3)taskid_t:t(17,62)=(17,46)projid_t:t(17,63)=(17,46)pthread_t:t(17,64)=(17,7)pthread_key_t:t(17,65)=(17,7)_pthread_mutex:T(17,66)=s24__pthread_mutex_flags:(17,67)=s8__pthread_mutex_flag1:(19,6),0,16;__pthread_mutex_flag2:(19,5),16,8;__pthread_mutex_ceiling:(19,5),24,8;__pthread_mutex_type:(19,6),32,16;__pthread_mutex_magic:(19,6),48,16;;,0,64;__pthread_mutex_lock:(17,68)=u8__pthread_mutex_lock64:(17,69)=s8__pthread_mutex_pad:(17,70)=ar(18,3);0;7;(19,5),0,64;;,0,64;__pthread_mutex_lock32:(17,71)=s8__pthread_ownerpid:(19,7),0,32;__pthread_lockword:(19,7),32,32;;,0,64;__pthread_mutex_owner64:(17,34),0,64;;,64,64;__pthread_mutex_data:(17,34),128,64;;pthread_mutex_t:t(17,72)=(17,66)_pthread_cond:T(17,73)=s16__pthread_cond_flags:(17,74)=s8__pthread_cond_flag:(17,75)=ar(18,3);0;3;(19,5),0,32;__pthread_cond_type:(19,6),32,16;__pthread_cond_magic:(19,6),48,16;;,0,64;__pthread_cond_data:(17,34),64,64;;pthread_cond_t:t(17,76)=(17,73)_pthread_rwlock:T(17,77)=s64__pthread_rwlock_readers:(19,3),0,32;__pthread_rwlock_type:(19,6),32,16;__pthread_rwlock_magic:(19,6),48,16;__pthread_rwlock_mutex:(17,72),64,192;__pthread_rwlock_readercv:(17,76),256,128;__pthread_rwlock_writercv:(17,76),384,128;;pthread_rwlock_t:t(17,78)=(17,77)_pthread_attr:T(17,79)=s4__pthread_attrp:(9,2),0,32;;pthread_attr_t:t(17,80)=(17,79)_pthread_mutexattr:T(17,81)=s4__pthread_mutexattrp:(9,2),0,32;;pthread_mutexattr_t:t(17,82)=(17,81)_pthread_condattr:T(17,83)=s4__pthread_condattrp:(9,2),0,32;;pthread_condattr_t:t(17,84)=(17,83)_once:T(17,85)=s32__pthread_once_pad:(17,86)=ar(18,3);0;3;(17,34),0,256;;pthread_once_t:t(17,87)=(17,85)_pthread_rwlockattr:T(17,88)=s4__pthread_rwlockattrp:(9,2),0,32;;pthread_rwlockattr_t:t(17,89)=(17,88)dev_t:t(17,90)=(17,8)nlink_t:t(17,91)=(17,8)pid_t:t(17,92)=(0,3)time_t:t(17,93)=(0,3)clock_t:t(17,94)=(0,3)clockid_t:t(17,95)=(0,1)timer_t:t(17,96)=(0,1)unchar:t(17,97)=(0,11)ushort:t(17,98)=(0,9)uint:t(17,99)=(0,4)ulong:t(17,100)=(0,5)u_char:t(17,101)=(0,11)u_short:t(17,102)=(0,9)u_int:t(17,103)=(0,4)u_long:t(17,104)=(0,5)_quad:T(17,105)=s8val:(17,106)=ar(18,3);0;1;(0,1),0,64;;quad_t:t(17,107)=(17,105)quad:t(17,108)=(17,107)/usr/include/sys/select.h/usr/include/sys/time.htimeval:T(21,1)=s8tv_sec:(17,93),0,32;tv_usec:(17,48),32,32;;timezone:T(21,2)=s8tz_minuteswest:(0,1),0,32;tz_dsttime:(0,1),32,32;;/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/sys/types.hitimerval:T(21,3)=s16it_interval:(21,1),0,64;it_value:(21,1),64,64;;hrtime_t:t(21,4)=(17,1)/usr/include/time.h/usr/include/sys/select.hfd_mask:t(20,1)=(0,3)fds_mask:t(20,2)=(0,3)fd_set:T(20,3)=s128fds_bits:(20,4)=ar(18,3);0;31;(0,3),0,1024;;fd_set:t(20,5)=(20,3)/usr/include/iso/time_iso.htm:T(25,1)=s36tm_sec:(0,1),0,32;tm_min:(0,1),32,32;tm_hour:(0,1),64,32;tm_mday:(0,1),96,32;tm_mon:(0,1),128,32;tm_year:(0,1),160,32;tm_wday:(0,1),192,32;tm_yday:(0,1),224,32;tm_isdst:(0,1),256,32;;/usr/include/sys/time_impl.htimespec:T(26,1)=s8tv_sec:(17,93),0,32;tv_nsec:(0,3),32,32;;timespec_t:t(26,2)=(26,1)timestruc_t:t(26,3)=(26,1)itimerspec:T(26,4)=s16it_interval:(26,1),0,64;it_value:(26,1),64,64;;itimerspec_t:t(26,5)=(26,4)sigval:T(16,1)=u4sival_int:(0,1),0,32;sival_ptr:(9,2),0,32;;sigevent:T(16,2)=s24sigev_notify:(0,1),0,32;sigev_signo:(0,1),32,32;sigev_value:(16,1),64,32;sigev_notify_function:(16,3)=*(16,4)=f(0,22),96,32;sigev_notify_attributes:(16,5)=*(17,80),128,32;__sigev_pad2:(0,1),160,32;;/usr/include/locale.h/usr/include/iso/locale_iso.hlconv:T(28,1)=s48decimal_point:(17,10),0,32;thousands_sep:(17,10),32,32;grouping:(17,10),64,32;int_curr_symbol:(17,10),96,32;currency_symbol:(17,10),128,32;mon_decimal_point:(17,10),160,32;mon_thousands_sep:(17,10),192,32;mon_grouping:(17,10),224,32;positive_sign:(17,10),256,32;negative_sign:(17,10),288,32;int_frac_digits:(0,2),320,8;frac_digits:(0,2),328,8;p_cs_precedes:(0,2),336,8;p_sep_by_space:(0,2),344,8;n_cs_precedes:(0,2),352,8;n_sep_by_space:(0,2),360,8;p_sign_posn:(0,2),368,8;n_sign_posn:(0,2),376,8;;/usr/local/include/libintl.h/usr/include/locale.hinternal.hconfig.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/limits.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/syslimits.h/usr/include/iso/limits_iso.h/usr/include/sys/int_limits.h/usr/include/setjmp.h/usr/include/iso/setjmp_iso.hjmp_buf:t(38,1)=(38,2)=ar(18,3);0;11;(0,1)sigjmp_buf:t(37,1)=(37,2)=ar(18,3);0;18;(0,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdarg.hva_list:t(39,1)=(7,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stddef.hpcre.hpcre:t(41,1)=(41,2)=xsreal_pcre:pcre_extra:T(41,3)=s16flags:(0,5),0,32;study_data:(9,2),32,32;match_limit:(0,5),64,32;callout_data:(9,2),96,32;;pcre_extra:t(41,4)=(41,3)pcre_callout_block:T(41,5)=s40version:(0,1),0,32;callout_number:(0,1),32,32;offset_vector:(41,6)=*(0,1),64,32;subject:(41,7)=*(41,8)=k(0,2),96,32;subject_length:(0,1),128,32;start_match:(0,1),160,32;current_position:(0,1),192,32;capture_top:(0,1),224,32;capture_last:(0,1),256,32;callout_data:(9,2),288,32;;pcre_callout_block:t(41,9)=(41,5)BOOL:t(31,1)=(0,1) :T(31,2)=eESC_A:1,ESC_G:2,ESC_B:3,ESC_b:4,ESC_D:5,ESC_d:6,ESC_S:7,ESC_s:8,ESC_W:9,ESC_w:10,ESC_dum1:11,ESC_C:12,ESC_Z:13,ESC_z:14,ESC_E:15,ESC_Q:16,ESC_REF:17,; :T(31,3)=eOP_END:0,OP_SOD:1,OP_SOM:2,OP_NOT_WORD_BOUNDARY:3,OP_WORD_BOUNDARY:4,OP_NOT_DIGIT:5,OP_DIGIT:6,OP_NOT_WHITESPACE:7,OP_WHITESPACE:8,OP_NOT_WORDCHAR:9,OP_WORDCHAR:10,OP_ANY:11,OP_ANYBYTE:12,OP_EODN:13,OP_EOD:14,OP_OPT:15,OP_CIRC:16,OP_DOLL:17,OP_CHARS:18,OP_NOT:19,OP_STAR:20,OP_MINSTAR:21,OP_PLUS:22,OP_MINPLUS:23,OP_QUERY:24,OP_MINQUERY:25,OP_UPTO:26,OP_MINUPTO:27,OP_EXACT:28,OP_NOTSTAR:29,OP_NOTMINSTAR:30,OP_NOTPLUS:31,OP_NOTMINPLUS:32,OP_NOTQUERY:33,OP_NOTMINQUERY:34,OP_NOTUPTO:35,OP_NOTMINUPTO:36,OP_NOTEXACT:37,OP_TYPESTAR:38,OP_TYPEMINSTAR:39,OP_TYPEPLUS:40,OP_TYPEMINPLUS:41,OP_TYPEQUERY:42,OP_TYPEMINQUERY:43,OP_TYPEUPTO:44,OP_TYPEMINUPTO:45,OP_TYPEEXACT:46,OP_CRSTAR:47,OP_CRMINSTAR:48,OP_CRPLUS:49,OP_CRMINPLUS:50,OP_CRQUERY:51,OP_CRMINQUERY:52,OP_CRRANGE:53,OP_CRMINRANGE:54,OP_CLASS:55,OP_NCLASS:56,OP_XCLASS:57,OP_REF:58,OP_RECURSE:59,OP_CALLOUT:60,OP_ALT:61,OP_KET:62,OP_KETRMAX:63,OP_KETRMIN:64,OP_ASSERT:65,OP_ASSERT_NOT:66,OP_ASSERTBACK:67,OP_ASSERTBACK_NOT:68,OP_REVERSE:69,OP_ONCE:70,OP_COND:71,OP_CREF:72,OP_BRAZERO:73,OP_BRAMINZERO:74,\OP_BRANUMBER:75,OP_BRA:76,;uschar:t(31,4)=(0,11)real_pcre:T(41,2)=s28magic_number:(0,5),0,32;size:(8,3),32,32;tables:(31,5)=*(31,6)=k(0,11),64,32;options:(0,5),96,32;top_bracket:(0,9),128,16;top_backref:(0,9),144,16;first_byte:(0,9),160,16;req_byte:(0,9),176,16;name_entry_size:(0,9),192,16;name_count:(0,9),208,16;;real_pcre:t(31,7)=(41,2)pcre_study_data:T(31,8)=s40size:(8,3),0,32;options:(31,4),32,8;start_bits:(31,9)=ar(18,3);0;31;(31,4),40,256;;pcre_study_data:t(31,10)=(31,8)compile_data:T(31,11)=s44lcc:(31,12)=*(31,13)=k(31,4),0,32;fcc:(31,12),32,32;cbits:(31,12),64,32;ctypes:(31,12),96,32;start_code:(31,12),128,32;name_table:(31,14)=*(31,4),160,32;names_found:(0,1),192,32;name_entry_size:(0,1),224,32;top_backref:(0,1),256,32;backref_map:(0,4),288,32;req_varyopt:(0,1),320,32;;compile_data:t(31,15)=(31,11)branch_chain:T(31,16)=s8outer:(31,17)=*(31,16),0,32;current:(31,14),32,32;;branch_chain:t(31,18)=(31,16)recursion_info:T(31,19)=s24prevrec:(31,20)=*(31,19),0,32;group_num:(0,1),32,32;after_call:(31,12),64,32;save_start:(31,12),96,32;offset_save:(41,6),128,32;saved_max:(0,1),160,32;;recursion_info:t(31,21)=(31,19)match_data:T(31,22)=s96match_call_count:(0,5),0,32;match_limit:(0,5),32,32;offset_vector:(41,6),64,32;offset_end:(0,1),96,32;offset_max:(0,1),128,32;lcc:(31,12),160,32;ctypes:(31,12),192,32;offset_overflow:(31,1),224,32;notbol:(31,1),256,32;noteol:(31,1),288,32;utf8:(31,1),320,32;endonly:(31,1),352,32;notempty:(31,1),384,32;start_code:(31,12),416,32;start_subject:(31,12),448,32;end_subject:(31,12),480,32;start_match:(31,12),512,32;end_match_ptr:(31,12),544,32;end_offset_top:(0,1),576,32;capture_last:(0,1),608,32;start_offset:(0,1),640,32;recursive:(31,23)=*(31,21),672,32;callout_data:(9,2),704,32;thisframe:(31,24)=*(31,25)=xsheapframe:,736,32;;match_data:t(31,26)=(31,22)pcreposix.h :T(42,1)=eREG_ASSERT:1,REG_BADBR:2,REG_BADPAT:3,REG_BADRPT:4,REG_EBRACE:5,REG_EBRACK:6,REG_ECOLLATE:7,REG_ECTYPE:8,REG_EESCAPE:9,REG_EMPTY:10,REG_EPAREN:11,REG_ERANGE:12,REG_ESIZE:13,REG_ESPACE:14,REG_ESUBREG:15,REG_INVARG:16,REG_NOMATCH:17,;regex_t:t(42,2)=(42,3)=s12re_pcre:(9,2),0,32;re_nsub:(8,3),32,32;re_erroffset:(8,3),64,32;;regoff_t:t(42,4)=(0,1)regmatch_t:t(42,5)=(42,6)=s8rm_so:(42,4),0,32;rm_eo:(42,4),32,32;;printint.cprint_char:f(0,1)f:P(43,1)=*(8,2)ptr:P(31,14)utf8:P(31,1)printint.cc:r(0,1)i:r(0,1)a:r(0,1)s:r(0,1)i:r(0,1)a:r(0,1)s:r(0,1)print_internals:f(0,22)external_re:P(43,2)=*(41,1)f:P(43,1)codestart:r(31,14)code:r(31,14)utf8:r(31,1)ccode:r(31,14)c:r(0,1)extra:r(0,1)charlength:r(0,1)extrabytes:r(0,1)extrabytes:r(0,1)i:r(0,1)min:r(0,1)max:r(0,1)printmap:r(31,1)j:r(0,1)ch:r(0,1)ch:r(0,1)j:r(0,1)get_value:f(0,1)str:P(11,2)endptr:P(1,1)=*(11,2)pcretest.cresult:r(0,1)ord2utf8:f(0,1)cvalue:P(0,1)buffer:P(11,2)i:r(0,1)j:r(0,1)utf82ord:f(0,1)buffer:P(11,2)vptr:P(41,6)c:r(0,1)d:r(0,1)i:r(0,1)j:r(0,1)s:r(0,1)pchars:f(0,1)p:P(11,2)length:P(0,1)f:P(43,1)c:(0,1)yield:r(0,1)rc:r(0,1)rc:r(0,1)n:(0,1)n:(0,1)callout:f(0,1)cb:P(1,2)=*(41,9)f:r(43,1)i:r(0,1)pre_start:r(0,1)post_start:r(0,1)callout_data:r(0,1)callout_data:r(0,1)new_malloc:f(9,2)size:P(8,3)block:r(9,2)block:r(9,2)new_free:f(0,22)block:P(9,2)stack_malloc:f(9,2)size:P(8,3)block:r(9,2)stack_free:f(0,22)block:P(9,2)new_info:f(0,22)re:P(43,2)study:P(1,3)=*(41,4)option:P(0,1)ptr:P(9,2)rc:r(0,1)main:F(0,1)argc:P(0,1)argv:P(1,4)=*(17,10)infile:(43,1)options:(0,1)op:r(0,1)timeit:(0,1)showinfo:(0,1)showstore:(0,1)size_offsets:(0,1)size_offsets_max:(0,1)offsets:(41,6)posix:(0,1)debug:(0,1)done:(0,1)buffer:(11,2)dbuffer:(11,2)re:(43,2)extra:r(1,3)preg:(42,2)do_posix:r(0,1)error:(41,7)p:r(11,2)pp:r(11,2)ppp:r(11,2)tables:(31,5)do_study:r(0,1)do_debug:r(0,1)do_G:(0,1)do_g:(0,1)do_showinfo:r(0,1)do_showrest:(0,1)erroroffset:(0,1)len:r(0,1)re:(43,2)extra:r(1,3)preg:(42,2)do_posix:r(0,1)error:(41,7)p:r(11,2)pp:r(11,2)ppp:r(11,2)tables:(31,5)do_study:r(0,1)do_debug:r(0,1)do_G:(0,1)do_g:(0,1)do_showinfo:r(0,1)do_showrest:(0,1)erroroffset:(0,1)len:r(0,1)rc:r(0,1)cflags:r(0,1)q:r(11,2)bptr:r(11,2)use_offsets:r(41,6)use_size_offsets:r(0,1)callout_data:(0,1)callout_data_set:(0,1)count:r(0,1)c:r(0,1)copystrings:r(0,1)find_match_limit:(0,1)getstrings:r(0,1)getlist:(0,1)gmatched:(0,1)start_offset:r(0,1)g_notempty:(0,1)i:r(0,1)n:r(0,1)rc:r(0,1)eflags:r(0,1)pmatch:r(1,5)=*(42,5)i:r(8,3)i:r(8,3)min:r(0,1)mid:r(0,1)max:r(0,1)i:r(0,1)copybuffer:(1,6)=ar(18,3);0;15;(0,2)rc:r(0,1)substring:(41,7)rc:r(0,1)stringlist:(1,7)=*(41,7)rc:r(0,1)i:r(0,1)stringlist:(1,7)rc:r(0,1)substring:(41,7)rc:r(0,1)substring:(41,7)rc:r(0,1)copybuffer:(1,6)rc:r(0,1)copybuffer:(1,6)rc:r(0,1)onechar:r(0,1)tb:r(0,1)tb:r(0,1)min:r(0,1)mid:r(0,1)max:r(0,1)i:r(0,1)time_taken:r(17,94)start_time:r(17,94)i:r(0,1)n:r(0,1)name:(1,8)=ar(18,3);0;255;(31,4)npp:r(31,14)sign:r(0,1)name:(1,8)npp:r(31,14)pt:r(11,2)buff8:(1,9)=ar(18,3);0;7;(0,11)ii:r(0,1)utn:r(0,1)rc:r(0,1)cflags:r(0,1)get_options:(0,5)old_first_char:(0,1)old_options:(0,1)old_count:r(0,1)count:(0,1)backrefmax:(0,1)first_char:(0,1)need_char:(0,1)nameentrysize:(0,1)namecount:(0,1)nametable:(31,12)size:(8,3)ch:r(0,1)caseless:r(41,7)ch:r(0,1)caseless:r(41,7)size:(8,3)start_bits:(31,14)i:r(0,1)c:r(0,1)i:r(0,1)c:r(0,1)i:r(0,1)time_taken:r(17,94)start_time:r(17,94)get_options:(0,5)old_first_char:(0,1)old_options:(0,1)old_count:r(0,1)count:(0,1)backrefmax:(0,1)first_char:(0,1)need_char:(0,1)nameentrysize:(0,1)namecount:(0,1)nametable:(31,12)size:(8,3)ch:r(0,1)caseless:r(41,7)get_options:(0,5)old_first_char:(0,1)old_options:(0,1)old_count:r(0,1)count:(0,1)backrefmax:(0,1)first_char:(0,1)need_char:(0,1)nameentrysize:(0,1)namecount:(0,1)nametable:(31,12)size:(8,3)ch:r(0,1)caseless:r(41,7)i:r(0,1)time_taken:r(17,94)start_time:r(17,94)endptr:(11,2)endptr:(11,2)endptr:(11,2)re:(43,2)extra:r(1,3)preg:(42,2)do_posix:r(0,1)error:(41,7)p:r(11,2)pp:r(11,2)ppp:r(11,2)tables:(31,5)do_study:r(0,1)do_debug:r(0,1)do_G:(0,1)do_g:(0,1)do_showinfo:r(0,1)do_showrest:(0,1)erroroffset:(0,1)len:r(0,1)q:r(11,2)bptr:r(11,2)use_offsets:r(41,6)use_size_offsets:r(0,1)callout_data:(0,1)callout_data_set:(0,1)count:r(0,1)c:r(0,1)copystrings:r(0,1)find_match_limit:(0,1)getstrings:r(0,1)getlist:(0,1)gmatched:(0,1)start_offset:r(0,1)g_notempty:(0,1)i:r(0,1)n:r(0,1)endptr:(11,2)rc:(0,1)outfile:S(43,1)log_store:S(0,1)callout_count:S(0,1)callout_extra:S(0,1)callout_fail_count:S(0,1)callout_fail_id:S(0,1)first_callout:S(0,1)show_malloc:S(0,1)use_utf8:S(0,1)gotten_store:S(8,3)utf8_table1:S(1,10)=ar(18,3);0;5;(1,11)=k(0,1)utf8_table2:S(1,12)=ar(18,3);0;5;(1,11)utf8_table3:S(1,13)=ar(18,3);0;5;(1,11)OP_lengths:S(1,14)=ar(18,3);0;76;(31,4)OP_names:S(1,15)=ar(18,3);0;76;(41,7)utf8_t3:S(1,16)=ar(18,3);0;5;(1,11)utf8_t4:S(1,17)=ar(18,3);0;63;(31,13)   "$$o 4 4 -B T T$  7B x x` AB  K <QIIWII]IIeXX(jXX, oZZx[[~]X]X]`]`]h]h]l]l]p]p]x]x]t X glYn$ oP  gF0707010004e686000041ed0000000a0000000a00000003402cbe2300000000000000880000000500000000000000000000000aff350889reloc/doc07070100003b7e000041ed0000000a0000000a00000003402cbe2300000000000000880000000500000000000000000000000fff350889reloc/doc/pcre07070100003b7f000081a40000000a0000000a00000001402cbd65000000b30000008800000005000000000000000000000017ff35088ereloc/doc/pcre/AUTHORSWritten by: Philip Hazel University of Cambridge Computing Service, Cambridge, England. Phone: +44 1223 334714. Copyright (c) 1997-2003 University of Cambridge 07070100003b80000081a40000000a0000000a00000001402cbd65000008aa0000008800000005000000000000000000000017ff35088ereloc/doc/pcre/COPYINGPCRE LICENCE ------------ PCRE is a library of functions to support regular expressions whose syntax and semantics are as close as possible to those of the Perl 5 language. Written by: Philip Hazel University of Cambridge Computing Service, Cambridge, England. Phone: +44 1223 334714. Copyright (c) 1997-2003 University of Cambridge Permission is granted to anyone to use this software for any purpose on any computer system, and to redistribute it freely, subject to the following restrictions: 1. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 2. The origin of this software must not be misrepresented, either by explicit claim or by omission. In practice, this means that if you use PCRE in software that you distribute to others, commercially or otherwise, you must put a sentence like this Regular expression support is provided by the PCRE library package, which is open source software, written by Philip Hazel, and copyright by the University of Cambridge, England. somewhere reasonably visible in your documentation and in any relevant files or online help data or similar. A reference to the ftp site for the source, that is, to ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ should also be given in the documentation. However, this condition is not intended to apply to whole chains of software. If package A includes PCRE, it must acknowledge it, but if package B is software that includes package A, the condition is not imposed on package B (unless it uses PCRE independently). 3. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. If PCRE is embedded in any software that is released under the GNU General Purpose Licence (GPL), or Lesser General Purpose Licence (LGPL), then the terms of that licence shall supersede any condition above with which it is incompatible. The documentation for PCRE, supplied in the "doc" directory, is distributed under the same terms as the software itself. End 07070100003b81000081a40000000a0000000a00000001402cbd650000fd6b0000008800000005000000000000000000000019ff35088ereloc/doc/pcre/ChangeLogChangeLog for PCRE ------------------ Version 4.5 01-Dec-03 --------------------- 1. There has been some re-arrangement of the code for the match() function so that it can be compiled in a version that does not call itself recursively. Instead, it keeps those local variables that need separate instances for each "recursion" in a frame on the heap, and gets/frees frames whenever it needs to "recurse". Keeping track of where control must go is done by means of setjmp/longjmp. The whole thing is implemented by a set of macros that hide most of the details from the main code, and operates only if NO_RECURSE is defined while compiling pcre.c. If PCRE is built using the "configure" mechanism, "--disable-stack-for-recursion" turns on this way of operating. To make it easier for callers to provide specially tailored get/free functions for this usage, two new functions, pcre_stack_malloc, and pcre_stack_free, are used. They are always called in strict stacking order, and the size of block requested is always the same. The PCRE_CONFIG_STACKRECURSE info parameter can be used to find out whether PCRE has been compiled to use the stack or the heap for recursion. The -C option of pcretest uses this to show which version is compiled. A new data escape \S, is added to pcretest; it causes the amounts of store obtained and freed by both kinds of malloc/free at match time to be added to the output. 2. Changed the locale test to use "fr_FR" instead of "fr" because that's what's available on my current Linux desktop machine. 3. When matching a UTF-8 string, the test for a valid string at the start has been extended. If start_offset is not zero, PCRE now checks that it points to a byte that is the start of a UTF-8 character. If not, it returns PCRE_ERROR_BADUTF8_OFFSET (-11). Note: the whole string is still checked; this is necessary because there may be backward assertions in the pattern. When matching the same subject several times, it may save resources to use PCRE_NO_UTF8_CHECK on all but the first call if the string is long. 4. The code for checking the validity of UTF-8 strings has been tightened so that it rejects (a) strings containing 0xfe or 0xff bytes and (b) strings containing "overlong sequences". 5. Fixed a bug (appearing twice) that I could not find any way of exploiting! I had written "if ((digitab[*p++] && chtab_digit) == 0)" where the "&&" should have been "&", but it just so happened that all the cases this let through by mistake were picked up later in the function. 6. I had used a variable called "isblank" - this is a C99 function, causing some compilers to warn. To avoid this, I renamed it (as "blankclass"). 7. Cosmetic: (a) only output another newline at the end of pcretest if it is prompting; (b) run "./pcretest /dev/null" at the start of the test script so the version is shown; (c) stop "make test" echoing "./RunTest". 8. Added patches from David Burgess to enable PCRE to run on EBCDIC systems. 9. The prototype for memmove() for systems that don't have it was using size_t, but the inclusion of the header that defines size_t was later. I've moved the #includes for the C headers earlier to avoid this. 10. Added some adjustments to the code to make it easier to compiler on certain special systems: (a) Some "const" qualifiers were missing. (b) Added the macro EXPORT before all exported functions; by default this is defined to be empty. (c) Changed the dftables auxiliary program (that builds chartables.c) so that it reads its output file name as an argument instead of writing to the standard output and assuming this can be redirected. 11. In UTF-8 mode, if a recursive reference (e.g. (?1)) followed a character class containing characters with values greater than 255, PCRE compilation went into a loop. 12. A recursive reference to a subpattern that was within another subpattern that had a minimum quantifier of zero caused PCRE to crash. For example, (x(y(?2))z)? provoked this bug with a subject that got as far as the recursion. If the recursively-called subpattern itself had a zero repeat, that was OK. 13. In pcretest, the buffer for reading a data line was set at 30K, but the buffer into which it was copied (for escape processing) was still set at 1024, so long lines caused crashes. 14. A pattern such as /[ab]{1,3}+/ failed to compile, giving the error "internal error: code overflow...". This applied to any character class that was followed by a possessive quantifier. 15. Modified the Makefile to add libpcre.la as a prerequisite for libpcreposix.la because I was told this is needed for a parallel build to work. 16. If a pattern that contained .* following optional items at the start was studied, the wrong optimizing data was generated, leading to matching errors. For example, studying /[ab]*.*c/ concluded, erroneously, that any matching string must start with a or b or c. The correct conclusion for this pattern is that a match can start with any character. Version 4.4 13-Aug-03 --------------------- 1. In UTF-8 mode, a character class containing characters with values between 127 and 255 was not handled correctly if the compiled pattern was studied. In fixing this, I have also improved the studying algorithm for such classes (slightly). 2. Three internal functions had redundant arguments passed to them. Removal might give a very teeny performance improvement. 3. Documentation bug: the value of the capture_top field in a callout is *one more than* the number of the hightest numbered captured substring. 4. The Makefile linked pcretest and pcregrep with -lpcre, which could result in incorrectly linking with a previously installed version. They now link explicitly with libpcre.la. 5. configure.in no longer needs to recognize Cygwin specially. 6. A problem in pcre.in for Windows platforms is fixed. 7. If a pattern was successfully studied, and the -d (or /D) flag was given to pcretest, it used to include the size of the study block as part of its output. Unfortunately, the structure contains a field that has a different size on different hardware architectures. This meant that the tests that showed this size failed. As the block is currently always of a fixed size, this information isn't actually particularly useful in pcretest output, so I have just removed it. 8. Three pre-processor statements accidentally did not start in column 1. Sadly, there are *still* compilers around that complain, even though standard C has not required this for well over a decade. Sigh. 9. In pcretest, the code for checking callouts passed small integers in the callout_data field, which is a void * field. However, some picky compilers complained about the casts involved for this on 64-bit systems. Now pcretest passes the address of the small integer instead, which should get rid of the warnings. 10. By default, when in UTF-8 mode, PCRE now checks for valid UTF-8 strings at both compile and run time, and gives an error if an invalid UTF-8 sequence is found. There is a option for disabling this check in cases where the string is known to be correct and/or the maximum performance is wanted. 11. In response to a bug report, I changed one line in Makefile.in from -Wl,--out-implib,.libs/lib@WIN_PREFIX@pcreposix.dll.a \ to -Wl,--out-implib,.libs/@WIN_PREFIX@libpcreposix.dll.a \ to look similar to other lines, but I have no way of telling whether this is the right thing to do, as I do not use Windows. No doubt I'll get told if it's wrong... Version 4.3 21-May-03 --------------------- 1. Two instances of @WIN_PREFIX@ omitted from the Windows targets in the Makefile. 2. Some refactoring to improve the quality of the code: (i) The utf8_table... variables are now declared "const". (ii) The code for \cx, which used the "case flipping" table to upper case lower case letters, now just substracts 32. This is ASCII-specific, but the whole concept of \cx is ASCII-specific, so it seems reasonable. (iii) PCRE was using its character types table to recognize decimal and hexadecimal digits in the pattern. This is silly, because it handles only 0-9, a-f, and A-F, but the character types table is locale- specific, which means strange things might happen. A private table is now used for this - though it costs 256 bytes, a table is much faster than multiple explicit tests. Of course, the standard character types table is still used for matching digits in subject strings against \d. (iv) Strictly, the identifier ESC_t is reserved by POSIX (all identifiers ending in _t are). So I've renamed it as ESC_tee. 3. The first argument for regexec() in the POSIX wrapper should have been defined as "const". 4. Changed pcretest to use malloc() for its buffers so that they can be Electric Fenced for debugging. 5. There were several places in the code where, in UTF-8 mode, PCRE would try to read one or more bytes before the start of the subject string. Often this had no effect on PCRE's behaviour, but in some circumstances it could provoke a segmentation fault. 6. A lookbehind at the start of a pattern in UTF-8 mode could also cause PCRE to try to read one or more bytes before the start of the subject string. 7. A lookbehind in a pattern matched in non-UTF-8 mode on a PCRE compiled with UTF-8 support could misbehave in various ways if the subject string contained bytes with the 0x80 bit set and the 0x40 bit unset in a lookbehind area. (PCRE was not checking for the UTF-8 mode flag, and trying to move back over UTF-8 characters.) Version 4.2 14-Apr-03 --------------------- 1. Typo "#if SUPPORT_UTF8" instead of "#ifdef SUPPORT_UTF8" fixed. 2. Changes to the building process, supplied by Ronald Landheer-Cieslak [ON_WINDOWS]: new variable, "#" on non-Windows platforms [NOT_ON_WINDOWS]: new variable, "#" on Windows platforms [WIN_PREFIX]: new variable, "cyg" for Cygwin * Makefile.in: use autoconf substitution for OBJEXT, EXEEXT, BUILD_OBJEXT and BUILD_EXEEXT Note: automatic setting of the BUILD variables is not yet working set CPPFLAGS and BUILD_CPPFLAGS (but don't use yet) - should be used at compile-time but not at link-time [LINK]: use for linking executables only make different versions for Windows and non-Windows [LINKLIB]: new variable, copy of UNIX-style LINK, used for linking libraries [LINK_FOR_BUILD]: new variable [OBJEXT]: use throughout [EXEEXT]: use throughout : new target : new target : use native compiler : use native linker : handle Windows platform correctly : ditto : ditto copy DLL to top builddir before testing As part of these changes, -no-undefined was removed again. This was reported to give trouble on HP-UX 11.0, so getting rid of it seems like a good idea in any case. 3. Some tidies to get rid of compiler warnings: . In the match_data structure, match_limit was an unsigned long int, whereas match_call_count was an int. I've made them both unsigned long ints. . In pcretest the fact that a const uschar * doesn't automatically cast to a void * provoked a warning. . Turning on some more compiler warnings threw up some "shadow" variables and a few more missing casts. 4. If PCRE was complied with UTF-8 support, but called without the PCRE_UTF8 option, a class that contained a single character with a value between 128 and 255 (e.g. /[\xFF]/) caused PCRE to crash. 5. If PCRE was compiled with UTF-8 support, but called without the PCRE_UTF8 option, a class that contained several characters, but with at least one whose value was between 128 and 255 caused PCRE to crash. Version 4.1 12-Mar-03 --------------------- 1. Compiling with gcc -pedantic found a couple of places where casts were needed, and a string in dftables.c that was longer than standard compilers are required to support. 2. Compiling with Sun's compiler found a few more places where the code could be tidied up in order to avoid warnings. 3. The variables for cross-compiling were called HOST_CC and HOST_CFLAGS; the first of these names is deprecated in the latest Autoconf in favour of the name CC_FOR_BUILD, because "host" is typically used to mean the system on which the compiled code will be run. I can't find a reference for HOST_CFLAGS, but by analogy I have changed it to CFLAGS_FOR_BUILD. 4. Added -no-undefined to the linking command in the Makefile, because this is apparently helpful for Windows. To make it work, also added "-L. -lpcre" to the linking step for the pcreposix library. 5. PCRE was failing to diagnose the case of two named groups with the same name. 6. A problem with one of PCRE's optimizations was discovered. PCRE remembers a literal character that is needed in the subject for a match, and scans along to ensure that it is present before embarking on the full matching process. This saves time in cases of nested unlimited repeats that are never going to match. Problem: the scan can take a lot of time if the subject is very long (e.g. megabytes), thus penalizing straightforward matches. It is now done only if the amount of subject to be scanned is less than 1000 bytes. 7. A lesser problem with the same optimization is that it was recording the first character of an anchored pattern as "needed", thus provoking a search right along the subject, even when the first match of the pattern was going to fail. The "needed" character is now not set for anchored patterns, unless it follows something in the pattern that is of non-fixed length. Thus, it still fulfils its original purpose of finding quick non-matches in cases of nested unlimited repeats, but isn't used for simple anchored patterns such as /^abc/. Version 4.0 17-Feb-03 --------------------- 1. If a comment in an extended regex that started immediately after a meta-item extended to the end of string, PCRE compiled incorrect data. This could lead to all kinds of weird effects. Example: /#/ was bad; /()#/ was bad; /a#/ was not. 2. Moved to autoconf 2.53 and libtool 1.4.2. 3. Perl 5.8 no longer needs "use utf8" for doing UTF-8 things. Consequently, the special perltest8 script is no longer needed - all the tests can be run from a single perltest script. 4. From 5.004, Perl has not included the VT character (0x0b) in the set defined by \s. It has now been removed in PCRE. This means it isn't recognized as whitespace in /x regexes too, which is the same as Perl. Note that the POSIX class [:space:] *does* include VT, thereby creating a mess. 5. Added the class [:blank:] (a GNU extension from Perl 5.8) to match only space and tab. 6. Perl 5.005 was a long time ago. It's time to amalgamate the tests that use its new features into the main test script, reducing the number of scripts. 7. Perl 5.8 has changed the meaning of patterns like /a(?i)b/. Earlier versions were backward compatible, and made the (?i) apply to the whole pattern, as if /i were given. Now it behaves more logically, and applies the option setting only to what follows. PCRE has been changed to follow suit. However, if it finds options settings right at the start of the pattern, it extracts them into the global options, as before. Thus, they show up in the info data. 8. Added support for the \Q...\E escape sequence. Characters in between are treated as literals. This is slightly different from Perl in that $ and @ are also handled as literals inside the quotes. In Perl, they will cause variable interpolation. Note the following examples: Pattern PCRE matches Perl matches \Qabc$xyz\E abc$xyz abc followed by the contents of $xyz \Qabc\$xyz\E abc\$xyz abc\$xyz \Qabc\E\$\Qxyz\E abc$xyz abc$xyz For compatibility with Perl, \Q...\E sequences are recognized inside character classes as well as outside them. 9. Re-organized 3 code statements in pcretest to avoid "overflow in floating-point constant arithmetic" warnings from a Microsoft compiler. Added a (size_t) cast to one statement in pcretest and one in pcreposix to avoid signed/unsigned warnings. 10. SunOS4 doesn't have strtoul(). This was used only for unpicking the -o option for pcretest, so I've replaced it by a simple function that does just that job. 11. pcregrep was ending with code 0 instead of 2 for the commands "pcregrep" or "pcregrep -". 12. Added "possessive quantifiers" ?+, *+, ++, and {,}+ which come from Sun's Java package. This provides some syntactic sugar for simple cases of what my documentation calls "once-only subpatterns". A pattern such as x*+ is the same as (?>x*). In other words, if what is inside (?>...) is just a single repeated item, you can use this simplified notation. Note that only makes sense with greedy quantifiers. Consequently, the use of the possessive quantifier forces greediness, whatever the setting of the PCRE_UNGREEDY option. 13. A change of greediness default within a pattern was not taking effect at the current level for patterns like /(b+(?U)a+)/. It did apply to parenthesized subpatterns that followed. Patterns like /b+(?U)a+/ worked because the option was abstracted outside. 14. PCRE now supports the \G assertion. It is true when the current matching position is at the start point of the match. This differs from \A when the starting offset is non-zero. Used with the /g option of pcretest (or similar code), it works in the same way as it does for Perl's /g option. If all alternatives of a regex begin with \G, the expression is anchored to the start match position, and the "anchored" flag is set in the compiled expression. 15. Some bugs concerning the handling of certain option changes within patterns have been fixed. These applied to options other than (?ims). For example, "a(?x: b c )d" did not match "XabcdY" but did match "Xa b c dY". It should have been the other way round. Some of this was related to change 7 above. 16. PCRE now gives errors for /[.x.]/ and /[=x=]/ as unsupported POSIX features, as Perl does. Previously, PCRE gave the warnings only for /[[.x.]]/ and /[[=x=]]/. PCRE now also gives an error for /[:name:]/ because it supports POSIX classes only within a class (e.g. /[[:alpha:]]/). 17. Added support for Perl's \C escape. This matches one byte, even in UTF8 mode. Unlike ".", it always matches newline, whatever the setting of PCRE_DOTALL. However, PCRE does not permit \C to appear in lookbehind assertions. Perl allows it, but it doesn't (in general) work because it can't calculate the length of the lookbehind. At least, that's the case for Perl 5.8.0 - I've been told they are going to document that it doesn't work in future. 18. Added an error diagnosis for escapes that PCRE does not support: these are \L, \l, \N, \P, \p, \U, \u, and \X. 19. Although correctly diagnosing a missing ']' in a character class, PCRE was reading past the end of the pattern in cases such as /[abcd/. 20. PCRE was getting more memory than necessary for patterns with classes that contained both POSIX named classes and other characters, e.g. /[[:space:]abc/. 21. Added some code, conditional on #ifdef VPCOMPAT, to make life easier for compiling PCRE for use with Virtual Pascal. 22. Small fix to the Makefile to make it work properly if the build is done outside the source tree. 23. Added a new extension: a condition to go with recursion. If a conditional subpattern starts with (?(R) the "true" branch is used if recursion has happened, whereas the "false" branch is used only at the top level. 24. When there was a very long string of literal characters (over 255 bytes without UTF support, over 250 bytes with UTF support), the computation of how much memory was required could be incorrect, leading to segfaults or other strange effects. 25. PCRE was incorrectly assuming anchoring (either to start of subject or to start of line for a non-DOTALL pattern) when a pattern started with (.*) and there was a subsequent back reference to those brackets. This meant that, for example, /(.*)\d+\1/ failed to match "abc123bc". Unfortunately, it isn't possible to check for precisely this case. All we can do is abandon the optimization if .* occurs inside capturing brackets when there are any back references whatsoever. (See below for a better fix that came later.) 26. The handling of the optimization for finding the first character of a non-anchored pattern, and for finding a character that is required later in the match were failing in some cases. This didn't break the matching; it just failed to optimize when it could. The way this is done has been re-implemented. 27. Fixed typo in error message for invalid (?R item (it said "(?p"). 28. Added a new feature that provides some of the functionality that Perl provides with (?{...}). The facility is termed a "callout". The way it is done in PCRE is for the caller to provide an optional function, by setting pcre_callout to its entry point. Like pcre_malloc and pcre_free, this is a global variable. By default it is unset, which disables all calling out. To get the function called, the regex must include (?C) at appropriate points. This is, in fact, equivalent to (?C0), and any number <= 255 may be given with (?C). This provides a means of identifying different callout points. When PCRE reaches such a point in the regex, if pcre_callout has been set, the external function is called. It is provided with data in a structure called pcre_callout_block, which is defined in pcre.h. If the function returns 0, matching continues; if it returns a non-zero value, the match at the current point fails. However, backtracking will occur if possible. [This was changed later and other features added - see item 49 below.] 29. pcretest is upgraded to test the callout functionality. It provides a callout function that displays information. By default, it shows the start of the match and the current position in the text. There are some new data escapes to vary what happens: \C+ in addition, show current contents of captured substrings \C- do not supply a callout function \C!n return 1 when callout number n is reached \C!n!m return 1 when callout number n is reached for the mth time 30. If pcregrep was called with the -l option and just a single file name, it output "" if a match was found, instead of the file name. 31. Improve the efficiency of the POSIX API to PCRE. If the number of capturing slots is less than POSIX_MALLOC_THRESHOLD, use a block on the stack to pass to pcre_exec(). This saves a malloc/free per call. The default value of POSIX_MALLOC_THRESHOLD is 10; it can be changed by --with-posix-malloc-threshold when configuring. 32. The default maximum size of a compiled pattern is 64K. There have been a few cases of people hitting this limit. The code now uses macros to handle the storing of links as offsets within the compiled pattern. It defaults to 2-byte links, but this can be changed to 3 or 4 bytes by --with-link-size when configuring. Tests 2 and 5 work only with 2-byte links because they output debugging information about compiled patterns. 33. Internal code re-arrangements: (a) Moved the debugging function for printing out a compiled regex into its own source file (printint.c) and used #include to pull it into pcretest.c and, when DEBUG is defined, into pcre.c, instead of having two separate copies. (b) Defined the list of op-code names for debugging as a macro in internal.h so that it is next to the definition of the opcodes. (c) Defined a table of op-code lengths for simpler skipping along compiled code. This is again a macro in internal.h so that it is next to the definition of the opcodes. 34. Added support for recursive calls to individual subpatterns, along the lines of Robin Houston's patch (but implemented somewhat differently). 35. Further mods to the Makefile to help Win32. Also, added code to pcregrep to allow it to read and process whole directories in Win32. This code was contributed by Lionel Fourquaux; it has not been tested by me. 36. Added support for named subpatterns. The Python syntax (?P...) is used to name a group. Names consist of alphanumerics and underscores, and must be unique. Back references use the syntax (?P=name) and recursive calls use (?P>name) which is a PCRE extension to the Python extension. Groups still have numbers. The function pcre_fullinfo() can be used after compilation to extract a name/number map. There are three relevant calls: PCRE_INFO_NAMEENTRYSIZE yields the size of each entry in the map PCRE_INFO_NAMECOUNT yields the number of entries PCRE_INFO_NAMETABLE yields a pointer to the map. The map is a vector of fixed-size entries. The size of each entry depends on the length of the longest name used. The first two bytes of each entry are the group number, most significant byte first. There follows the corresponding name, zero terminated. The names are in alphabetical order. 37. Make the maximum literal string in the compiled code 250 for the non-UTF-8 case instead of 255. Making it the same both with and without UTF-8 support means that the same test output works with both. 38. There was a case of malloc(0) in the POSIX testing code in pcretest. Avoid calling malloc() with a zero argument. 39. Change 25 above had to resort to a heavy-handed test for the .* anchoring optimization. I've improved things by keeping a bitmap of backreferences with numbers 1-31 so that if .* occurs inside capturing brackets that are not in fact referenced, the optimization can be applied. It is unlikely that a relevant occurrence of .* (i.e. one which might indicate anchoring or forcing the match to follow \n) will appear inside brackets with a number greater than 31, but if it does, any back reference > 31 suppresses the optimization. 40. Added a new compile-time option PCRE_NO_AUTO_CAPTURE. This has the effect of disabling numbered capturing parentheses. Any opening parenthesis that is not followed by ? behaves as if it were followed by ?: but named parentheses can still be used for capturing (and they will acquire numbers in the usual way). 41. Redesigned the return codes from the match() function into yes/no/error so that errors can be passed back from deep inside the nested calls. A malloc failure while inside a recursive subpattern call now causes the PCRE_ERROR_NOMEMORY return instead of quietly going wrong. 42. It is now possible to set a limit on the number of times the match() function is called in a call to pcre_exec(). This facility makes it possible to limit the amount of recursion and backtracking, though not in a directly obvious way, because the match() function is used in a number of different circumstances. The count starts from zero for each position in the subject string (for non-anchored patterns). The default limit is, for compatibility, a large number, namely 10 000 000. You can change this in two ways: (a) When configuring PCRE before making, you can use --with-match-limit=n to set a default value for the compiled library. (b) For each call to pcre_exec(), you can pass a pcre_extra block in which a different value is set. See 45 below. If the limit is exceeded, pcre_exec() returns PCRE_ERROR_MATCHLIMIT. 43. Added a new function pcre_config(int, void *) to enable run-time extraction of things that can be changed at compile time. The first argument specifies what is wanted and the second points to where the information is to be placed. The current list of available information is: PCRE_CONFIG_UTF8 The output is an integer that is set to one if UTF-8 support is available; otherwise it is set to zero. PCRE_CONFIG_NEWLINE The output is an integer that it set to the value of the code that is used for newline. It is either LF (10) or CR (13). PCRE_CONFIG_LINK_SIZE The output is an integer that contains the number of bytes used for internal linkage in compiled expressions. The value is 2, 3, or 4. See item 32 above. PCRE_CONFIG_POSIX_MALLOC_THRESHOLD The output is an integer that contains the threshold above which the POSIX interface uses malloc() for output vectors. See item 31 above. PCRE_CONFIG_MATCH_LIMIT The output is an unsigned integer that contains the default limit of the number of match() calls in a pcre_exec() execution. See 42 above. 44. pcretest has been upgraded by the addition of the -C option. This causes it to extract all the available output from the new pcre_config() function, and to output it. The program then exits immediately. 45. A need has arisen to pass over additional data with calls to pcre_exec() in order to support additional features. One way would have been to define pcre_exec2() (for example) with extra arguments, but this would not have been extensible, and would also have required all calls to the original function to be mapped to the new one. Instead, I have chosen to extend the mechanism that is used for passing in "extra" data from pcre_study(). The pcre_extra structure is now exposed and defined in pcre.h. It currently contains the following fields: flags a bitmap indicating which of the following fields are set study_data opaque data from pcre_study() match_limit a way of specifying a limit on match() calls for a specific call to pcre_exec() callout_data data for callouts (see 49 below) The flag bits are also defined in pcre.h, and are PCRE_EXTRA_STUDY_DATA PCRE_EXTRA_MATCH_LIMIT PCRE_EXTRA_CALLOUT_DATA The pcre_study() function now returns one of these new pcre_extra blocks, with the actual study data pointed to by the study_data field, and the PCRE_EXTRA_STUDY_DATA flag set. This can be passed directly to pcre_exec() as before. That is, this change is entirely upwards-compatible and requires no change to existing code. If you want to pass in additional data to pcre_exec(), you can either place it in a pcre_extra block provided by pcre_study(), or create your own pcre_extra block. 46. pcretest has been extended to test the PCRE_EXTRA_MATCH_LIMIT feature. If a data string contains the escape sequence \M, pcretest calls pcre_exec() several times with different match limits, until it finds the minimum value needed for pcre_exec() to complete. The value is then output. This can be instructive; for most simple matches the number is quite small, but for pathological cases it gets very large very quickly. 47. There's a new option for pcre_fullinfo() called PCRE_INFO_STUDYSIZE. It returns the size of the data block pointed to by the study_data field in a pcre_extra block, that is, the value that was passed as the argument to pcre_malloc() when PCRE was getting memory in which to place the information created by pcre_study(). The fourth argument should point to a size_t variable. pcretest has been extended so that this information is shown after a successful pcre_study() call when information about the compiled regex is being displayed. 48. Cosmetic change to Makefile: there's no need to have / after $(DESTDIR) because what follows is always an absolute path. (Later: it turns out that this is more than cosmetic for MinGW, because it doesn't like empty path components.) 49. Some changes have been made to the callout feature (see 28 above): (i) A callout function now has three choices for what it returns: 0 => success, carry on matching > 0 => failure at this point, but backtrack if possible < 0 => serious error, return this value from pcre_exec() Negative values should normally be chosen from the set of PCRE_ERROR_xxx values. In particular, returning PCRE_ERROR_NOMATCH forces a standard "match failed" error. The error number PCRE_ERROR_CALLOUT is reserved for use by callout functions. It will never be used by PCRE itself. (ii) The pcre_extra structure (see 45 above) has a void * field called callout_data, with corresponding flag bit PCRE_EXTRA_CALLOUT_DATA. The pcre_callout_block structure has a field of the same name. The contents of the field passed in the pcre_extra structure are passed to the callout function in the corresponding field in the callout block. This makes it easier to use the same callout-containing regex from multiple threads. For testing, the pcretest program has a new data escape \C*n pass the number n (may be negative) as callout_data If the callout function in pcretest receives a non-zero value as callout_data, it returns that value. 50. Makefile wasn't handling CFLAGS properly when compiling dftables. Also, there were some redundant $(CFLAGS) in commands that are now specified as $(LINK), which already includes $(CFLAGS). 51. Extensions to UTF-8 support are listed below. These all apply when (a) PCRE has been compiled with UTF-8 support *and* pcre_compile() has been compiled with the PCRE_UTF8 flag. Patterns that are compiled without that flag assume one-byte characters throughout. Note that case-insensitive matching applies only to characters whose values are less than 256. PCRE doesn't support the notion of cases for higher-valued characters. (i) A character class whose characters are all within 0-255 is handled as a bit map, and the map is inverted for negative classes. Previously, a character > 255 always failed to match such a class; however it should match if the class was a negative one (e.g. [^ab]). This has been fixed. (ii) A negated character class with a single character < 255 is coded as "not this character" (OP_NOT). This wasn't working properly when the test character was multibyte, either singly or repeated. (iii) Repeats of multibyte characters are now handled correctly in UTF-8 mode, for example: \x{100}{2,3}. (iv) The character escapes \b, \B, \d, \D, \s, \S, \w, and \W (either singly or repeated) now correctly test multibyte characters. However, PCRE doesn't recognize any characters with values greater than 255 as digits, spaces, or word characters. Such characters always match \D, \S, and \W, and never match \d, \s, or \w. (v) Classes may now contain characters and character ranges with values greater than 255. For example: [ab\x{100}-\x{400}]. (vi) pcregrep now has a --utf-8 option (synonym -u) which makes it call PCRE in UTF-8 mode. 52. The info request value PCRE_INFO_FIRSTCHAR has been renamed PCRE_INFO_FIRSTBYTE because it is a byte value. However, the old name is retained for backwards compatibility. (Note that LASTLITERAL is also a byte value.) 53. The single man page has become too large. I have therefore split it up into a number of separate man pages. These also give rise to individual HTML pages; these are now put in a separate directory, and there is an index.html page that lists them all. Some hyperlinking between the pages has been installed. 54. Added convenience functions for handling named capturing parentheses. 55. Unknown escapes inside character classes (e.g. [\M]) and escapes that aren't interpreted therein (e.g. [\C]) are literals in Perl. This is now also true in PCRE, except when the PCRE_EXTENDED option is set, in which case they are faulted. 56. Introduced HOST_CC and HOST_CFLAGS which can be set in the environment when calling configure. These values are used when compiling the dftables.c program which is run to generate the source of the default character tables. They default to the values of CC and CFLAGS. If you are cross-compiling PCRE, you will need to set these values. 57. Updated the building process for Windows DLL, as provided by Fred Cox. Version 3.9 02-Jan-02 --------------------- 1. A bit of extraneous text had somehow crept into the pcregrep documentation. 2. If --disable-static was given, the building process failed when trying to build pcretest and pcregrep. (For some reason it was using libtool to compile them, which is not right, as they aren't part of the library.) Version 3.8 18-Dec-01 --------------------- 1. The experimental UTF-8 code was completely screwed up. It was packing the bytes in the wrong order. How dumb can you get? Version 3.7 29-Oct-01 --------------------- 1. In updating pcretest to check change 1 of version 3.6, I screwed up. This caused pcretest, when used on the test data, to segfault. Unfortunately, this didn't happen under Solaris 8, where I normally test things. 2. The Makefile had to be changed to make it work on BSD systems, where 'make' doesn't seem to recognize that ./xxx and xxx are the same file. (This entry isn't in ChangeLog distributed with 3.7 because I forgot when I hastily made this fix an hour or so after the initial 3.7 release.) Version 3.6 23-Oct-01 --------------------- 1. Crashed with /(sens|respons)e and \1ibility/ and "sense and sensibility" if offsets passed as NULL with zero offset count. 2. The config.guess and config.sub files had not been updated when I moved to the latest autoconf. Version 3.5 15-Aug-01 --------------------- 1. Added some missing #if !defined NOPOSIX conditionals in pcretest.c that had been forgotten. 2. By using declared but undefined structures, we can avoid using "void" definitions in pcre.h while keeping the internal definitions of the structures private. 3. The distribution is now built using autoconf 2.50 and libtool 1.4. From a user point of view, this means that both static and shared libraries are built by default, but this can be individually controlled. More of the work of handling this static/shared cases is now inside libtool instead of PCRE's make file. 4. The pcretest utility is now installed along with pcregrep because it is useful for users (to test regexs) and by doing this, it automatically gets relinked by libtool. The documentation has been turned into a man page, so there are now .1, .txt, and .html versions in /doc. 5. Upgrades to pcregrep: (i) Added long-form option names like gnu grep. (ii) Added --help to list all options with an explanatory phrase. (iii) Added -r, --recursive to recurse into sub-directories. (iv) Added -f, --file to read patterns from a file. 6. pcre_exec() was referring to its "code" argument before testing that argument for NULL (and giving an error if it was NULL). 7. Upgraded Makefile.in to allow for compiling in a different directory from the source directory. 8. Tiny buglet in pcretest: when pcre_fullinfo() was called to retrieve the options bits, the pointer it was passed was to an int instead of to an unsigned long int. This mattered only on 64-bit systems. 9. Fixed typo (3.4/1) in pcre.h again. Sigh. I had changed pcre.h (which is generated) instead of pcre.in, which it its source. Also made the same change in several of the .c files. 10. A new release of gcc defines printf() as a macro, which broke pcretest because it had an ifdef in the middle of a string argument for printf(). Fixed by using separate calls to printf(). 11. Added --enable-newline-is-cr and --enable-newline-is-lf to the configure script, to force use of CR or LF instead of \n in the source. On non-Unix systems, the value can be set in config.h. 12. The limit of 200 on non-capturing parentheses is a _nesting_ limit, not an absolute limit. Changed the text of the error message to make this clear, and likewise updated the man page. 13. The limit of 99 on the number of capturing subpatterns has been removed. The new limit is 65535, which I hope will not be a "real" limit. Version 3.4 22-Aug-00 --------------------- 1. Fixed typo in pcre.h: unsigned const char * changed to const unsigned char *. 2. Diagnose condition (?(0) as an error instead of crashing on matching. Version 3.3 01-Aug-00 --------------------- 1. If an octal character was given, but the value was greater than \377, it was not getting masked to the least significant bits, as documented. This could lead to crashes in some systems. 2. Perl 5.6 (if not earlier versions) accepts classes like [a-\d] and treats the hyphen as a literal. PCRE used to give an error; it now behaves like Perl. 3. Added the functions pcre_free_substring() and pcre_free_substring_list(). These just pass their arguments on to (pcre_free)(), but they are provided because some uses of PCRE bind it to non-C systems that can call its functions, but cannot call free() or pcre_free() directly. 4. Add "make test" as a synonym for "make check". Corrected some comments in the Makefile. 5. Add $(DESTDIR)/ in front of all the paths in the "install" target in the Makefile. 6. Changed the name of pgrep to pcregrep, because Solaris has introduced a command called pgrep for grepping around the active processes. 7. Added the beginnings of support for UTF-8 character strings. 8. Arranged for the Makefile to pass over the settings of CC, CFLAGS, and RANLIB to ./ltconfig so that they are used by libtool. I think these are all the relevant ones. (AR is not passed because ./ltconfig does its own figuring out for the ar command.) Version 3.2 12-May-00 --------------------- This is purely a bug fixing release. 1. If the pattern /((Z)+|A)*/ was matched agained ZABCDEFG it matched Z instead of ZA. This was just one example of several cases that could provoke this bug, which was introduced by change 9 of version 2.00. The code for breaking infinite loops after an iteration that matches an empty string was't working correctly. 2. The pcretest program was not imitating Perl correctly for the pattern /a*/g when matched against abbab (for example). After matching an empty string, it wasn't forcing anchoring when setting PCRE_NOTEMPTY for the next attempt; this caused it to match further down the string than it should. 3. The code contained an inclusion of sys/types.h. It isn't clear why this was there because it doesn't seem to be needed, and it causes trouble on some systems, as it is not a Standard C header. It has been removed. 4. Made 4 silly changes to the source to avoid stupid compiler warnings that were reported on the Macintosh. The changes were from while ((c = *(++ptr)) != 0 && c != '\n'); to while ((c = *(++ptr)) != 0 && c != '\n') ; Totally extraordinary, but if that's what it takes... 5. PCRE is being used in one environment where neither memmove() nor bcopy() is available. Added HAVE_BCOPY and an autoconf test for it; if neither HAVE_MEMMOVE nor HAVE_BCOPY is set, use a built-in emulation function which assumes the way PCRE uses memmove() (always moving upwards). 6. PCRE is being used in one environment where strchr() is not available. There was only one use in pcre.c, and writing it out to avoid strchr() probably gives faster code anyway. Version 3.1 09-Feb-00 --------------------- The only change in this release is the fixing of some bugs in Makefile.in for the "install" target: (1) It was failing to install pcreposix.h. (2) It was overwriting the pcre.3 man page with the pcreposix.3 man page. Version 3.0 01-Feb-00 --------------------- 1. Add support for the /+ modifier to perltest (to output $` like it does in pcretest). 2. Add support for the /g modifier to perltest. 3. Fix pcretest so that it behaves even more like Perl for /g when the pattern matches null strings. 4. Fix perltest so that it doesn't do unwanted things when fed an empty pattern. Perl treats empty patterns specially - it reuses the most recent pattern, which is not what we want. Replace // by /(?#)/ in order to avoid this effect. 5. The POSIX interface was broken in that it was just handing over the POSIX captured string vector to pcre_exec(), but (since release 2.00) PCRE has required a bigger vector, with some working space on the end. This means that the POSIX wrapper now has to get and free some memory, and copy the results. 6. Added some simple autoconf support, placing the test data and the documentation in separate directories, re-organizing some of the information files, and making it build pcre-config (a GNU standard). Also added libtool support for building PCRE as a shared library, which is now the default. 7. Got rid of the leading zero in the definition of PCRE_MINOR because 08 and 09 are not valid octal constants. Single digits will be used for minor values less than 10. 8. Defined REG_EXTENDED and REG_NOSUB as zero in the POSIX header, so that existing programs that set these in the POSIX interface can use PCRE without modification. 9. Added a new function, pcre_fullinfo() with an extensible interface. It can return all that pcre_info() returns, plus additional data. The pcre_info() function is retained for compatibility, but is considered to be obsolete. 10. Added experimental recursion feature (?R) to handle one common case that Perl 5.6 will be able to do with (?p{...}). 11. Added support for POSIX character classes like [:alpha:], which Perl is adopting. Version 2.08 31-Aug-99 ---------------------- 1. When startoffset was not zero and the pattern began with ".*", PCRE was not trying to match at the startoffset position, but instead was moving forward to the next newline as if a previous match had failed. 2. pcretest was not making use of PCRE_NOTEMPTY when repeating for /g and /G, and could get into a loop if a null string was matched other than at the start of the subject. 3. Added definitions of PCRE_MAJOR and PCRE_MINOR to pcre.h so the version can be distinguished at compile time, and for completeness also added PCRE_DATE. 5. Added Paul Sokolovsky's minor changes to make it easy to compile a Win32 DLL in GnuWin32 environments. Version 2.07 29-Jul-99 ---------------------- 1. The documentation is now supplied in plain text form and HTML as well as in the form of man page sources. 2. C++ compilers don't like assigning (void *) values to other pointer types. In particular this affects malloc(). Although there is no problem in Standard C, I've put in casts to keep C++ compilers happy. 3. Typo on pcretest.c; a cast of (unsigned char *) in the POSIX regexec() call should be (const char *). 4. If NOPOSIX is defined, pcretest.c compiles without POSIX support. This may be useful for non-Unix systems who don't want to bother with the POSIX stuff. However, I haven't made this a standard facility. The documentation doesn't mention it, and the Makefile doesn't support it. 5. The Makefile now contains an "install" target, with editable destinations at the top of the file. The pcretest program is not installed. 6. pgrep -V now gives the PCRE version number and date. 7. Fixed bug: a zero repetition after a literal string (e.g. /abcde{0}/) was causing the entire string to be ignored, instead of just the last character. 8. If a pattern like /"([^\\"]+|\\.)*"/ is applied in the normal way to a non-matching string, it can take a very, very long time, even for strings of quite modest length, because of the nested recursion. PCRE now does better in some of these cases. It does this by remembering the last required literal character in the pattern, and pre-searching the subject to ensure it is present before running the real match. In other words, it applies a heuristic to detect some types of certain failure quickly, and in the above example, if presented with a string that has no trailing " it gives "no match" very quickly. 9. A new runtime option PCRE_NOTEMPTY causes null string matches to be ignored; other alternatives are tried instead. Version 2.06 09-Jun-99 ---------------------- 1. Change pcretest's output for amount of store used to show just the code space, because the remainder (the data block) varies in size between 32-bit and 64-bit systems. 2. Added an extra argument to pcre_exec() to supply an offset in the subject to start matching at. This allows lookbehinds to work when searching for multiple occurrences in a string. 3. Added additional options to pcretest for testing multiple occurrences: /+ outputs the rest of the string that follows a match /g loops for multiple occurrences, using the new startoffset argument /G loops for multiple occurrences by passing an incremented pointer 4. PCRE wasn't doing the "first character" optimization for patterns starting with \b or \B, though it was doing it for other lookbehind assertions. That is, it wasn't noticing that a match for a pattern such as /\bxyz/ has to start with the letter 'x'. On long subject strings, this gives a significant speed-up. Version 2.05 21-Apr-99 ---------------------- 1. Changed the type of magic_number from int to long int so that it works properly on 16-bit systems. 2. Fixed a bug which caused patterns starting with .* not to work correctly when the subject string contained newline characters. PCRE was assuming anchoring for such patterns in all cases, which is not correct because .* will not pass a newline unless PCRE_DOTALL is set. It now assumes anchoring only if DOTALL is set at top level; otherwise it knows that patterns starting with .* must be retried after every newline in the subject. Version 2.04 18-Feb-99 ---------------------- 1. For parenthesized subpatterns with repeats whose minimum was zero, the computation of the store needed to hold the pattern was incorrect (too large). If such patterns were nested a few deep, this could multiply and become a real problem. 2. Added /M option to pcretest to show the memory requirement of a specific pattern. Made -m a synonym of -s (which does this globally) for compatibility. 3. Subpatterns of the form (regex){n,m} (i.e. limited maximum) were being compiled in such a way that the backtracking after subsequent failure was pessimal. Something like (a){0,3} was compiled as (a)?(a)?(a)? instead of ((a)((a)(a)?)?)? with disastrous performance if the maximum was of any size. Version 2.03 02-Feb-99 ---------------------- 1. Fixed typo and small mistake in man page. 2. Added 4th condition (GPL supersedes if conflict) and created separate LICENCE file containing the conditions. 3. Updated pcretest so that patterns such as /abc\/def/ work like they do in Perl, that is the internal \ allows the delimiter to be included in the pattern. Locked out the use of \ as a delimiter. If \ immediately follows the final delimiter, add \ to the end of the pattern (to test the error). 4. Added the convenience functions for extracting substrings after a successful match. Updated pcretest to make it able to test these functions. Version 2.02 14-Jan-99 ---------------------- 1. Initialized the working variables associated with each extraction so that their saving and restoring doesn't refer to uninitialized store. 2. Put dummy code into study.c in order to trick the optimizer of the IBM C compiler for OS/2 into generating correct code. Apparently IBM isn't going to fix the problem. 3. Pcretest: the timing code wasn't using LOOPREPEAT for timing execution calls, and wasn't printing the correct value for compiling calls. Increased the default value of LOOPREPEAT, and the number of significant figures in the times. 4. Changed "/bin/rm" in the Makefile to "-rm" so it works on Windows NT. 5. Renamed "deftables" as "dftables" to get it down to 8 characters, to avoid a building problem on Windows NT with a FAT file system. Version 2.01 21-Oct-98 ---------------------- 1. Changed the API for pcre_compile() to allow for the provision of a pointer to character tables built by pcre_maketables() in the current locale. If NULL is passed, the default tables are used. Version 2.00 24-Sep-98 ---------------------- 1. Since the (>?) facility is in Perl 5.005, don't require PCRE_EXTRA to enable it any more. 2. Allow quantification of (?>) groups, and make it work correctly. 3. The first character computation wasn't working for (?>) groups. 4. Correct the implementation of \Z (it is permitted to match on the \n at the end of the subject) and add 5.005's \z, which really does match only at the very end of the subject. 5. Remove the \X "cut" facility; Perl doesn't have it, and (?> is neater. 6. Remove the ability to specify CASELESS, MULTILINE, DOTALL, and DOLLAR_END_ONLY at runtime, to make it possible to implement the Perl 5.005 localized options. All options to pcre_study() were also removed. 7. Add other new features from 5.005: $(?<= positive lookbehind $(?a*))*/ (a PCRE_EXTRA facility). Version 1.00 18-Nov-97 ---------------------- 1. Added compile-time macros to support systems such as SunOS4 which don't have memmove() or strerror() but have other things that can be used instead. 2. Arranged that "make clean" removes the executables. Version 0.99 27-Oct-97 ---------------------- 1. Fixed bug in code for optimizing classes with only one character. It was initializing a 32-byte map regardless, which could cause it to run off the end of the memory it had got. 2. Added, conditional on PCRE_EXTRA, the proposed (?>REGEX) construction. Version 0.98 22-Oct-97 ---------------------- 1. Fixed bug in code for handling temporary memory usage when there are more back references than supplied space in the ovector. This could cause segfaults. Version 0.97 21-Oct-97 ---------------------- 1. Added the \X "cut" facility, conditional on PCRE_EXTRA. 2. Optimized negated single characters not to use a bit map. 3. Brought error texts together as macro definitions; clarified some of them; fixed one that was wrong - it said "range out of order" when it meant "invalid escape sequence". 4. Changed some char * arguments to const char *. 5. Added PCRE_NOTBOL and PCRE_NOTEOL (from POSIX). 6. Added the POSIX-style API wrapper in pcreposix.a and testing facilities in pcretest. Version 0.96 16-Oct-97 ---------------------- 1. Added a simple "pgrep" utility to the distribution. 2. Fixed an incompatibility with Perl: "{" is now treated as a normal character unless it appears in one of the precise forms "{ddd}", "{ddd,}", or "{ddd,ddd}" where "ddd" means "one or more decimal digits". 3. Fixed serious bug. If a pattern had a back reference, but the call to pcre_exec() didn't supply a large enough ovector to record the related identifying subpattern, the match always failed. PCRE now remembers the number of the largest back reference, and gets some temporary memory in which to save the offsets during matching if necessary, in order to ensure that backreferences always work. 4. Increased the compatibility with Perl in a number of ways: (a) . no longer matches \n by default; an option PCRE_DOTALL is provided to request this handling. The option can be set at compile or exec time. (b) $ matches before a terminating newline by default; an option PCRE_DOLLAR_ENDONLY is provided to override this (but not in multiline mode). The option can be set at compile or exec time. (c) The handling of \ followed by a digit other than 0 is now supposed to be the same as Perl's. If the decimal number it represents is less than 10 or there aren't that many previous left capturing parentheses, an octal escape is read. Inside a character class, it's always an octal escape, even if it is a single digit. (d) An escaped but undefined alphabetic character is taken as a literal, unless PCRE_EXTRA is set. Currently this just reserves the remaining escapes. (e) {0} is now permitted. (The previous item is removed from the compiled pattern). 5. Changed all the names of code files so that the basic parts are no longer than 10 characters, and abolished the teeny "globals.c" file. 6. Changed the handling of character classes; they are now done with a 32-byte bit map always. 7. Added the -d and /D options to pcretest to make it possible to look at the internals of compilation without having to recompile pcre. Version 0.95 23-Sep-97 ---------------------- 1. Fixed bug in pre-pass concerning escaped "normal" characters such as \x5c or \x20 at the start of a run of normal characters. These were being treated as real characters, instead of the source characters being re-checked. Version 0.94 18-Sep-97 ---------------------- 1. The functions are now thread-safe, with the caveat that the global variables containing pointers to malloc() and free() or alternative functions are the same for all threads. 2. Get pcre_study() to generate a bitmap of initial characters for non- anchored patterns when this is possible, and use it if passed to pcre_exec(). Version 0.93 15-Sep-97 ---------------------- 1. /(b)|(:+)/ was computing an incorrect first character. 2. Add pcre_study() to the API and the passing of pcre_extra to pcre_exec(), but not actually doing anything yet. 3. Treat "-" characters in classes that cannot be part of ranges as literals, as Perl does (e.g. [-az] or [az-]). 4. Set the anchored flag if a branch starts with .* or .*? because that tests all possible positions. 5. Split up into different modules to avoid including unneeded functions in a compiled binary. However, compile and exec are still in one module. The "study" function is split off. 6. The character tables are now in a separate module whose source is generated by an auxiliary program - but can then be edited by hand if required. There are now no calls to isalnum(), isspace(), isdigit(), isxdigit(), tolower() or toupper() in the code. 7. Turn the malloc/free funtions variables into pcre_malloc and pcre_free and make them global. Abolish the function for setting them, as the caller can now set them directly. Version 0.92 11-Sep-97 ---------------------- 1. A repeat with a fixed maximum and a minimum of 1 for an ordinary character (e.g. /a{1,3}/) was broken (I mis-optimized it). 2. Caseless matching was not working in character classes if the characters in the pattern were in upper case. 3. Make ranges like [W-c] work in the same way as Perl for caseless matching. 4. Make PCRE_ANCHORED public and accept as a compile option. 5. Add an options word to pcre_exec() and accept PCRE_ANCHORED and PCRE_CASELESS at run time. Add escapes \A and \I to pcretest to cause it to pass them. 6. Give an error if bad option bits passed at compile or run time. 7. Add PCRE_MULTILINE at compile and exec time, and (?m) as well. Add \M to pcretest to cause it to pass that flag. 8. Add pcre_info(), to get the number of identifying subpatterns, the stored options, and the first character, if set. 9. Recognize C+ or C{n,m} where n >= 1 as providing a fixed starting character. Version 0.91 10-Sep-97 ---------------------- 1. PCRE was failing to diagnose unlimited repeats of subpatterns that could match the empty string as in /(a*)*/. It was looping and ultimately crashing. 2. PCRE was looping on encountering an indefinitely repeated back reference to a subpattern that had matched an empty string, e.g. /(a|)\1*/. It now does what Perl does - treats the match as successful. **** 07070100003b82000081a40000000a0000000a00000001402cbd6500001f710000008800000005000000000000000000000017ff35088ereloc/doc/pcre/INSTALLBasic Installation ================== These are generic installation instructions that apply to systems that can run the `configure' shell script - Unix systems and any that imitate it. They are not specific to PCRE. There are PCRE-specific instructions for non-Unix systems in the file NON-UNIX-USE. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. 07070100003b83000081a40000000a0000000a00000001402cbd65000008aa0000008800000005000000000000000000000017ff35088ereloc/doc/pcre/LICENCEPCRE LICENCE ------------ PCRE is a library of functions to support regular expressions whose syntax and semantics are as close as possible to those of the Perl 5 language. Written by: Philip Hazel University of Cambridge Computing Service, Cambridge, England. Phone: +44 1223 334714. Copyright (c) 1997-2003 University of Cambridge Permission is granted to anyone to use this software for any purpose on any computer system, and to redistribute it freely, subject to the following restrictions: 1. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 2. The origin of this software must not be misrepresented, either by explicit claim or by omission. In practice, this means that if you use PCRE in software that you distribute to others, commercially or otherwise, you must put a sentence like this Regular expression support is provided by the PCRE library package, which is open source software, written by Philip Hazel, and copyright by the University of Cambridge, England. somewhere reasonably visible in your documentation and in any relevant files or online help data or similar. A reference to the ftp site for the source, that is, to ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ should also be given in the documentation. However, this condition is not intended to apply to whole chains of software. If package A includes PCRE, it must acknowledge it, but if package B is software that includes package A, the condition is not imposed on package B (unless it uses PCRE independently). 3. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. If PCRE is embedded in any software that is released under the GNU General Purpose Licence (GPL), or Lesser General Purpose Licence (LGPL), then the terms of that licence shall supersede any condition above with which it is incompatible. The documentation for PCRE, supplied in the "doc" directory, is distributed under the same terms as the software itself. End 07070100003b84000081a40000000a0000000a00000001402cbd65000017fe0000008800000005000000000000000000000014ff35088ereloc/doc/pcre/NEWSNews about PCRE releases ------------------------ Release 4.5 01-Dec-03 --------------------- Again mainly a bug-fix and tidying release, with only a couple of new features: 1. It's possible now to compile PCRE so that it does not use recursive function calls when matching. Instead it gets memory from the heap. This slows things down, but may be necessary on systems with limited stacks. 2. UTF-8 string checking has been tightened to reject overlong sequences and to check that a starting offset points to the start of a character. Failure of the latter returns a new error code: PCRE_ERROR_BADUTF8_OFFSET. 3. PCRE can now be compiled for systems that use EBCDIC code. Release 4.4 21-Aug-03 --------------------- This is mainly a bug-fix and tidying release. The only new feature is that PCRE checks UTF-8 strings for validity by default. There is an option to suppress this, just in case anybody wants that teeny extra bit of performance. Releases 4.1 - 4.3 ------------------ Sorry, I forgot about updating the NEWS file for these releases. Please take a look at ChangeLog. Release 4.0 17-Feb-03 --------------------- There have been a lot of changes for the 4.0 release, adding additional functionality and mending bugs. Below is a list of the highlights of the new functionality. For full details of these features, please consult the documentation. For a complete list of changes, see the ChangeLog file. 1. Support for Perl's \Q...\E escapes. 2. "Possessive quantifiers" ?+, *+, ++, and {,}+ which come from Sun's Java package. They provide some syntactic sugar for simple cases of "atomic grouping". 3. Support for the \G assertion. It is true when the current matching position is at the start point of the match. 4. A new feature that provides some of the functionality that Perl provides with (?{...}). The facility is termed a "callout". The way it is done in PCRE is for the caller to provide an optional function, by setting pcre_callout to its entry point. To get the function called, the regex must include (?C) at appropriate points. 5. Support for recursive calls to individual subpatterns. This makes it really easy to get totally confused. 6. Support for named subpatterns. The Python syntax (?P...) is used to name a group. 7. Several extensions to UTF-8 support; it is now fairly complete. There is an option for pcregrep to make it operate in UTF-8 mode. 8. The single man page has been split into a number of separate man pages. These also give rise to individual HTML pages which are put in a separate directory. There is an index.html page that lists them all. Some hyperlinking between the pages has been installed. Release 3.5 15-Aug-01 --------------------- 1. The configuring system has been upgraded to use later versions of autoconf and libtool. By default it builds both a shared and a static library if the OS supports it. You can use --disable-shared or --disable-static on the configure command if you want only one of them. 2. The pcretest utility is now installed along with pcregrep because it is useful for users (to test regexs) and by doing this, it automatically gets relinked by libtool. The documentation has been turned into a man page, so there are now .1, .txt, and .html versions in /doc. 3. Upgrades to pcregrep: (i) Added long-form option names like gnu grep. (ii) Added --help to list all options with an explanatory phrase. (iii) Added -r, --recursive to recurse into sub-directories. (iv) Added -f, --file to read patterns from a file. 4. Added --enable-newline-is-cr and --enable-newline-is-lf to the configure script, to force use of CR or LF instead of \n in the source. On non-Unix systems, the value can be set in config.h. 5. The limit of 200 on non-capturing parentheses is a _nesting_ limit, not an absolute limit. Changed the text of the error message to make this clear, and likewise updated the man page. 6. The limit of 99 on the number of capturing subpatterns has been removed. The new limit is 65535, which I hope will not be a "real" limit. Release 3.3 01-Aug-00 --------------------- There is some support for UTF-8 character strings. This is incomplete and experimental. The documentation describes what is and what is not implemented. Otherwise, this is just a bug-fixing release. Release 3.0 01-Feb-00 --------------------- 1. A "configure" script is now used to configure PCRE for Unix systems. It builds a Makefile, a config.h file, and the pcre-config script. 2. PCRE is built as a shared library by default. 3. There is support for POSIX classes such as [:alpha:]. 5. There is an experimental recursion feature. ---------------------------------------------------------------------------- IMPORTANT FOR THOSE UPGRADING FROM VERSIONS BEFORE 2.00 Please note that there has been a change in the API such that a larger ovector is required at matching time, to provide some additional workspace. The new man page has details. This change was necessary in order to support some of the new functionality in Perl 5.005. IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.00 Another (I hope this is the last!) change has been made to the API for the pcre_compile() function. An additional argument has been added to make it possible to pass over a pointer to character tables built in the current locale by pcre_maketables(). To use the default tables, this new arguement should be passed as NULL. IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.05 Yet another (and again I hope this really is the last) change has been made to the API for the pcre_exec() function. An additional argument has been added to make it possible to start the match other than at the start of the subject string. This is important if there are lookbehinds. The new man page has the details, but you just want to convert existing programs, all you need to do is to stick in a new fifth argument to pcre_exec(), with a value of zero. For example, change pcre_exec(pattern, extra, subject, length, options, ovec, ovecsize) to pcre_exec(pattern, extra, subject, length, 0, options, ovec, ovecsize) **** 07070100003b85000081a40000000a0000000a00000001402cbd6500001505000000880000000500000000000000000000001cff35088ereloc/doc/pcre/NON-UNIX-USECompiling PCRE on non-Unix systems ---------------------------------- See below for comments on Cygwin or MinGW usage. I (Philip Hazel) have no knowledge of Windows sytems and how their libraries work. The items in the PCRE Makefile that relate to anything other than Unix-like systems have been contributed by PCRE users. There are some other comments and files in the Contrib directory on the ftp site that you may find useful. The following are generic comments about building PCRE: If you want to compile PCRE for a non-Unix system (or perhaps, more strictly, for a system that does not support "configure" and make files), note that PCRE consists entirely of code written in Standard C, and so should compile successfully on any machine with a Standard C compiler and library, using normal compiling commands to do the following: (1) Copy or rename the file config.in as config.h, and change the macros that define HAVE_STRERROR and HAVE_MEMMOVE to define them as 1 rather than 0. Unfortunately, because of the way Unix autoconf works, the default setting has to be 0. You may also want to make changes to other macros in config.h. In particular, if you want to force a specific value for newline, you can define the NEWLINE macro. The default is to use '\n', thereby using whatever value your compiler gives to '\n'. (2) Copy or rename the file pcre.in as pcre.h, and change the macro definitions for PCRE_MAJOR, PCRE_MINOR, and PCRE_DATE near its start to the values set in configure.in. (3) Compile dftables.c as a stand-alone program, and then run it with the single argument "chartables.c". This generates a set of standard character tables and writes them to that file. (4) Compile maketables.c, get.c, study.c and pcre.c and link them all together into an object library in whichever form your system keeps such libraries. This is the pcre library (chartables.c is included by means of an #include directive). If your system has static and shared libraries, you may have to do this once for each type. (5) Similarly, compile pcreposix.c and link it (on its own) as the pcreposix library. (6) Compile the test program pcretest.c. This needs the functions in the pcre and pcreposix libraries when linking. (7) Run pcretest on the testinput files in the testdata directory, and check that the output matches the corresponding testoutput files. You must use the -i option when checking testinput2. Note that the supplied files are in Unix format, with just LF characters as line terminators. You may need to edit them to change this if your system uses a different convention. If you have a system without "configure" but where you can use a Makefile, edit Makefile.in to create Makefile, substituting suitable values for the variables at the head of the file. Some help in building a Win32 DLL of PCRE in GnuWin32 environments was contributed by Paul Sokolovsky. These environments are Mingw32 (http://www.xraylith.wisc.edu/~khan/software/gnu-win32/) and CygWin (http://sourceware.cygnus.com/cygwin/). Paul comments: For CygWin, set CFLAGS=-mno-cygwin, and do 'make dll'. You'll get pcre.dll (containing pcreposix also), libpcre.dll.a, and dynamically linked pgrep and pcretest. If you have /bin/sh, run RunTest (three main test go ok, locale not supported). Changes to do MinGW with autoconf 2.50 were supplied by Fred Cox , who comments as follows: If you are using the PCRE DLL, the normal Unix style configure && make && make check && make install should just work[*]. If you want to statically link against the .a file, you must define PCRE_STATIC before including pcre.h, otherwise the pcre_malloc and pcre_free exported functions will be declared __declspec(dllimport), with hilarious results. See the configure.in and pcretest.c for how it is done for the static test. Also, there will only be a libpcre.la, not a libpcreposix.la, as you would expect from the Unix version. The single DLL includes the pcreposix interface. [*] But note that the supplied test files are in Unix format, with just LF characters as line terminators. You will have to edit them to change to CR LF terminators. A script for building PCRE using Borland's C++ compiler for use with VPASCAL was contributed by Alexander Tokarev. It is called makevp.bat. These are some further comments about Win32 builds from Mark Evans. They were contributed before Fred Cox's changes were made, so it is possible that they may no longer be relevant. "The documentation for Win32 builds is a bit shy. Under MSVC6 I followed their instructions to the letter, but there were still some things missing. (1) Must #define STATIC for entire project if linking statically. (I see no reason to use DLLs for code this compact.) This of course is a project setting in MSVC under Preprocessor. (2) Missing some #ifdefs relating to the function pointers pcre_malloc and pcre_free. See my solution below. (The stubs may not be mandatory but they made me feel better.)" ========================= #ifdef _WIN32 #include void* malloc_stub(size_t N) { return malloc(N); } void free_stub(void* p) { free(p); } void *(*pcre_malloc)(size_t) = &malloc_stub; void (*pcre_free)(void *) = &free_stub; #else void *(*pcre_malloc)(size_t) = malloc; void (*pcre_free)(void *) = free; #endif ========================= **** 07070100003b86000081a40000000a0000000a00000001402cbd650000418d0000008800000005000000000000000000000016ff35088ereloc/doc/pcre/READMEREADME file for PCRE (Perl-compatible regular expression library) ----------------------------------------------------------------- The latest release of PCRE is always available from ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-xxx.tar.gz Please read the NEWS file if you are upgrading from a previous release. PCRE has its own native API, but a set of "wrapper" functions that are based on the POSIX API are also supplied in the library libpcreposix. Note that this just provides a POSIX calling interface to PCRE: the regular expressions themselves still follow Perl syntax and semantics. The header file for the POSIX-style functions is called pcreposix.h. The official POSIX name is regex.h, but I didn't want to risk possible problems with existing files of that name by distributing it that way. To use it with an existing program that uses the POSIX API, it will have to be renamed or pointed at by a link. If you are using the POSIX interface to PCRE and there is already a POSIX regex library installed on your system, you must take care when linking programs to ensure that they link with PCRE's libpcreposix library. Otherwise they may pick up the "real" POSIX functions of the same name. Contributions by users of PCRE ------------------------------ You can find contributions from PCRE users in the directory ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Contrib where there is also a README file giving brief descriptions of what they are. Several of them provide support for compiling PCRE on various flavours of Windows systems (I myself do not use Windows). Some are complete in themselves; others are pointers to URLs containing relevant files. Building PCRE on a Unix-like system ----------------------------------- To build PCRE on a Unix-like system, first run the "configure" command from the PCRE distribution directory, with your current directory set to the directory where you want the files to be created. This command is a standard GNU "autoconf" configuration script, for which generic instructions are supplied in INSTALL. Most commonly, people build PCRE within its own distribution directory, and in this case, on many systems, just running "./configure" is sufficient, but the usual methods of changing standard defaults are available. For example, CFLAGS='-O2 -Wall' ./configure --prefix=/opt/local specifies that the C compiler should be run with the flags '-O2 -Wall' instead of the default, and that "make install" should install PCRE under /opt/local instead of the default /usr/local. If you want to build in a different directory, just run "configure" with that directory as current. For example, suppose you have unpacked the PCRE source into /source/pcre/pcre-xxx, but you want to build it in /build/pcre/pcre-xxx: cd /build/pcre/pcre-xxx /source/pcre/pcre-xxx/configure There are some optional features that can be included or omitted from the PCRE library. You can read more about them in the pcrebuild man page. . If you want to make use of the support for UTF-8 character strings in PCRE, you must add --enable-utf8 to the "configure" command. Without it, the code for handling UTF-8 is not included in the library. (Even when included, it still has to be enabled by an option at run time.) . You can build PCRE to recognized CR or NL as the newline character, instead of whatever your compiler uses for "\n", by adding --newline-is-cr or --newline-is-nl to the "configure" command, respectively. Only do this if you really understand what you are doing. On traditional Unix-like systems, the newline character is NL. . When called via the POSIX interface, PCRE uses malloc() to get additional storage for processing capturing parentheses if there are more than 10 of them. You can increase this threshold by setting, for example, --with-posix-malloc-threshold=20 on the "configure" command. . PCRE has a counter which can be set to limit the amount of resources it uses. If the limit is exceeded during a match, the match fails. The default is ten million. You can change the default by setting, for example, --with-match-limit=500000 on the "configure" command. This is just the default; individual calls to pcre_exec() can supply their own value. There is discussion on the pcreapi man page. . The default maximum compiled pattern size is around 64K. You can increase this by adding --with-link-size=3 to the "configure" command. You can increase it even more by setting --with-link-size=4, but this is unlikely ever to be necessary. If you build PCRE with an increased link size, test 2 (and 5 if you are using UTF-8) will fail. Part of the output of these tests is a representation of the compiled pattern, and this changes with the link size. . You can build PCRE so that its match() function does not call itself recursively. Instead, it uses blocks of data from the heap via special functions pcre_stack_malloc() and pcre_stack_free() to save data that would otherwise be saved on the stack. To build PCRE like this, use --disable-stack-for-recursion on the "configure" command. PCRE runs more slowly in this mode, but it may be necessary in environments with limited stack sizes. The "configure" script builds five files: . libtool is a script that builds shared and/or static libraries . Makefile is built by copying Makefile.in and making substitutions. . config.h is built by copying config.in and making substitutions. . pcre-config is built by copying pcre-config.in and making substitutions. . RunTest is a script for running tests Once "configure" has run, you can run "make". It builds two libraries called libpcre and libpcreposix, a test program called pcretest, and the pcregrep command. You can use "make install" to copy these, the public header files pcre.h and pcreposix.h, and the man pages to appropriate live directories on your system, in the normal way. Running "make install" also installs the command pcre-config, which can be used to recall information about the PCRE configuration and installation. For example, pcre-config --version prints the version number, and pcre-config --libs outputs information about where the library is installed. This command can be included in makefiles for programs that use PCRE, saving the programmer from having to remember too many details. Shared libraries on Unix-like systems ------------------------------------- The default distribution builds PCRE as two shared libraries and two static libraries, as long as the operating system supports shared libraries. Shared library support relies on the "libtool" script which is built as part of the "configure" process. The libtool script is used to compile and link both shared and static libraries. They are placed in a subdirectory called .libs when they are newly built. The programs pcretest and pcregrep are built to use these uninstalled libraries (by means of wrapper scripts in the case of shared libraries). When you use "make install" to install shared libraries, pcregrep and pcretest are automatically re-built to use the newly installed shared libraries before being installed themselves. However, the versions left in the source directory still use the uninstalled libraries. To build PCRE using static libraries only you must use --disable-shared when configuring it. For example ./configure --prefix=/usr/gnu --disable-shared Then run "make" in the usual way. Similarly, you can use --disable-static to build only shared libraries. Cross-compiling on a Unix-like system ------------------------------------- You can specify CC and CFLAGS in the normal way to the "configure" command, in order to cross-compile PCRE for some other host. However, during the building process, the dftables.c source file is compiled *and run* on the local host, in order to generate the default character tables (the chartables.c file). It therefore needs to be compiled with the local compiler, not the cross compiler. You can do this by specifying CC_FOR_BUILD (and if necessary CFLAGS_FOR_BUILD) when calling the "configure" command. If they are not specified, they default to the values of CC and CFLAGS. Building on non-Unix systems ---------------------------- For a non-Unix system, read the comments in the file NON-UNIX-USE, though if the system supports the use of "configure" and "make" you may be able to build PCRE in the same way as for Unix systems. PCRE has been compiled on Windows systems and on Macintoshes, but I don't know the details because I don't use those systems. It should be straightforward to build PCRE on any system that has a Standard C compiler, because it uses only Standard C functions. Testing PCRE ------------ To test PCRE on a Unix system, run the RunTest script that is created by the configuring process. (This can also be run by "make runtest", "make check", or "make test".) For other systems, see the instructions in NON-UNIX-USE. The script runs the pcretest test program (which is documented in its own man page) on each of the testinput files (in the testdata directory) in turn, and compares the output with the contents of the corresponding testoutput file. A file called testtry is used to hold the output from pcretest. To run pcretest on just one of the test files, give its number as an argument to RunTest, for example: RunTest 2 The first file can also be fed directly into the perltest script to check that Perl gives the same results. The only difference you should see is in the first few lines, where the Perl version is given instead of the PCRE version. The second set of tests check pcre_fullinfo(), pcre_info(), pcre_study(), pcre_copy_substring(), pcre_get_substring(), pcre_get_substring_list(), error detection, and run-time flags that are specific to PCRE, as well as the POSIX wrapper API. It also uses the debugging flag to check some of the internals of pcre_compile(). If you build PCRE with a locale setting that is not the standard C locale, the character tables may be different (see next paragraph). In some cases, this may cause failures in the second set of tests. For example, in a locale where the isprint() function yields TRUE for characters in the range 128-255, the use of [:isascii:] inside a character class defines a different set of characters, and this shows up in this test as a difference in the compiled code, which is being listed for checking. Where the comparison test output contains [\x00-\x7f] the test will contain [\x00-\xff], and similarly in some other cases. This is not a bug in PCRE. The third set of tests checks pcre_maketables(), the facility for building a set of character tables for a specific locale and using them instead of the default tables. The tests make use of the "fr_FR" (French) locale. Before running the test, the script checks for the presence of this locale by running the "locale" command. If that command fails, or if it doesn't include "fr_FR" in the list of available locales, the third test cannot be run, and a comment is output to say why. If running this test produces instances of the error ** Failed to set locale "fr_FR" in the comparison output, it means that locale is not available on your system, despite being listed by "locale". This does not mean that PCRE is broken. The fourth test checks the UTF-8 support. It is not run automatically unless PCRE is built with UTF-8 support. To do this you must set --enable-utf8 when running "configure". This file can be also fed directly to the perltest script, provided you are running Perl 5.8 or higher. (For Perl 5.6, a small patch, commented in the script, can be be used.) The fifth and final file tests error handling with UTF-8 encoding, and internal UTF-8 features of PCRE that are not relevant to Perl. Character tables ---------------- PCRE uses four tables for manipulating and identifying characters. The final argument of the pcre_compile() function is a pointer to a block of memory containing the concatenated tables. A call to pcre_maketables() can be used to generate a set of tables in the current locale. If the final argument for pcre_compile() is passed as NULL, a set of default tables that is built into the binary is used. The source file called chartables.c contains the default set of tables. This is not supplied in the distribution, but is built by the program dftables (compiled from dftables.c), which uses the ANSI C character handling functions such as isalnum(), isalpha(), isupper(), islower(), etc. to build the table sources. This means that the default C locale which is set for your system will control the contents of these default tables. You can change the default tables by editing chartables.c and then re-building PCRE. If you do this, you should probably also edit Makefile to ensure that the file doesn't ever get re-generated. The first two 256-byte tables provide lower casing and case flipping functions, respectively. The next table consists of three 32-byte bit maps which identify digits, "word" characters, and white space, respectively. These are used when building 32-byte bit maps that represent character classes. The final 256-byte table has bits indicating various character types, as follows: 1 white space character 2 letter 4 decimal digit 8 hexadecimal digit 16 alphanumeric or '_' 128 regular expression metacharacter or binary zero You should not alter the set of characters that contain the 128 bit, as that will cause PCRE to malfunction. Manifest -------- The distribution should contain the following files: (A) The actual source files of the PCRE library functions and their headers: dftables.c auxiliary program for building chartables.c get.c ) maketables.c ) study.c ) source of pcre.c ) the functions pcreposix.c ) printint.c ) pcre.in "source" for the header for the external API; pcre.h is built from this by "configure" pcreposix.h header for the external POSIX wrapper API internal.h header for internal use config.in template for config.h, which is built by configure (B) Auxiliary files: AUTHORS information about the author of PCRE ChangeLog log of changes to the code INSTALL generic installation instructions LICENCE conditions for the use of PCRE COPYING the same, using GNU's standard name Makefile.in template for Unix Makefile, which is built by configure NEWS important changes in this release NON-UNIX-USE notes on building PCRE on non-Unix systems README this file RunTest.in template for a Unix shell script for running tests config.guess ) files used by libtool, config.sub ) used only when building a shared library configure a configuring shell script (built by autoconf) configure.in the autoconf input used to build configure doc/Tech.Notes notes on the encoding doc/*.3 man page sources for the PCRE functions doc/*.1 man page sources for pcregrep and pcretest doc/html/* HTML documentation doc/pcre.txt plain text version of the man pages doc/pcretest.txt plain text documentation of test program doc/perltest.txt plain text documentation of Perl test program install-sh a shell script for installing files ltmain.sh file used to build a libtool script pcretest.c comprehensive test program pcredemo.c simple demonstration of coding calls to PCRE perltest Perl test program pcregrep.c source of a grep utility that uses PCRE pcre-config.in source of script which retains PCRE information testdata/testinput1 test data, compatible with Perl testdata/testinput2 test data for error messages and non-Perl things testdata/testinput3 test data for locale-specific tests testdata/testinput4 test data for UTF-8 tests compatible with Perl testdata/testinput5 test data for other UTF-8 tests testdata/testoutput1 test results corresponding to testinput1 testdata/testoutput2 test results corresponding to testinput2 testdata/testoutput3 test results corresponding to testinput3 testdata/testoutput4 test results corresponding to testinput4 testdata/testoutput5 test results corresponding to testinput5 (C) Auxiliary files for Win32 DLL dll.mk pcre.def (D) Auxiliary file for VPASCAL makevp.bat Philip Hazel December 2003 07070100014550000041ed0000000a0000000a00000003402cbe23000000000000008800000005000000000000000000000013ff35088ereloc/doc/pcre/doc07070100014551000081a40000000a0000000a00000001402cbd6400002cb2000000880000000500000000000000000000001eff350892reloc/doc/pcre/doc/Tech.NotesTechnical Notes about PCRE -------------------------- Many years ago I implemented some regular expression functions to an algorithm suggested by Martin Richards. These were not Unix-like in form, and were quite restricted in what they could do by comparison with Perl. The interesting part about the algorithm was that the amount of space required to hold the compiled form of an expression was known in advance. The code to apply an expression did not operate by backtracking, as the original Henry Spencer code and current Perl code does, but instead checked all possibilities simultaneously by keeping a list of current states and checking all of them as it advanced through the subject string. (In the terminology of Jeffrey Friedl's book, it was a "DFA algorithm".) When the pattern was all used up, all remaining states were possible matches, and the one matching the longest subset of the subject string was chosen. This did not necessarily maximize the individual wild portions of the pattern, as is expected in Unix and Perl-style regular expressions. By contrast, the code originally written by Henry Spencer and subsequently heavily modified for Perl actually compiles the expression twice: once in a dummy mode in order to find out how much store will be needed, and then for real. The execution function operates by backtracking and maximizing (or, optionally, minimizing in Perl) the amount of the subject that matches individual wild portions of the pattern. This is an "NFA algorithm" in Friedl's terminology. For the set of functions that forms PCRE (which are unrelated to those mentioned above), I tried at first to invent an algorithm that used an amount of store bounded by a multiple of the number of characters in the pattern, to save on compiling time. However, because of the greater complexity in Perl regular expressions, I couldn't do this. In any case, a first pass through the pattern is needed, for a number of reasons. PCRE works by running a very degenerate first pass to calculate a maximum store size, and then a second pass to do the real compile - which may use a bit less than the predicted amount of store. The idea is that this is going to turn out faster because the first pass is degenerate and the second pass can just store stuff straight into the vector. It does make the compiling functions bigger, of course, but they have got quite big anyway to handle all the Perl stuff. The compiled form of a pattern is a vector of bytes, containing items of variable length. The first byte in an item is an opcode, and the length of the item is either implicit in the opcode or contained in the data bytes which follow it. A list of all the opcodes follows: Opcodes with no following data ------------------------------ These items are all just one byte long OP_END end of pattern OP_ANY match any character OP_ANYBYTE match any single byte, even in UTF-8 mode OP_SOD match start of data: \A OP_SOM, start of match (subject + offset): \G OP_CIRC ^ (start of data, or after \n in multiline) OP_NOT_WORD_BOUNDARY \W OP_WORD_BOUNDARY \w OP_NOT_DIGIT \D OP_DIGIT \d OP_NOT_WHITESPACE \S OP_WHITESPACE \s OP_NOT_WORDCHAR \W OP_WORDCHAR \w OP_EODN match end of data or \n at end: \Z OP_EOD match end of data: \z OP_DOLL $ (end of data, or before \n in multiline) Repeating single characters --------------------------- The common repeats (*, +, ?) when applied to a single character appear as two-byte items using the following opcodes: OP_STAR OP_MINSTAR OP_PLUS OP_MINPLUS OP_QUERY OP_MINQUERY Those with "MIN" in their name are the minimizing versions. Each is followed by the character that is to be repeated. Other repeats make use of OP_UPTO OP_MINUPTO OP_EXACT which are followed by a two-byte count (most significant first) and the repeated character. OP_UPTO matches from 0 to the given number. A repeat with a non-zero minimum and a fixed maximum is coded as an OP_EXACT followed by an OP_UPTO (or OP_MINUPTO). Repeating character types ------------------------- Repeats of things like \d are done exactly as for single characters, except that instead of a character, the opcode for the type is stored in the data byte. The opcodes are: OP_TYPESTAR OP_TYPEMINSTAR OP_TYPEPLUS OP_TYPEMINPLUS OP_TYPEQUERY OP_TYPEMINQUERY OP_TYPEUPTO OP_TYPEMINUPTO OP_TYPEEXACT Matching a character string --------------------------- The OP_CHARS opcode is followed by a one-byte count and then that number of characters. If there are more than 255 characters in sequence, successive instances of OP_CHARS are used. Character classes ----------------- If there is only one character, OP_CHARS is used for a positive class, and OP_NOT for a negative one (that is, for something like [^a]). However, in UTF-8 mode, this applies only to characters with values < 128, because OP_NOT is confined to single bytes. Another set of repeating opcodes (OP_NOTSTAR etc.) are used for a repeated, negated, single-character class. The normal ones (OP_STAR etc.) are used for a repeated positive single-character class. When there's more than one character in a class and all the characters are less than 256, OP_CLASS is used for a positive class, and OP_NCLASS for a negative one. In either case, the opcode is followed by a 32-byte bit map containing a 1 bit for every character that is acceptable. The bits are counted from the least significant end of each byte. The reason for having both OP_CLASS and OP_NCLASS is so that, in UTF-8 mode, subject characters with values greater than 256 can be handled correctly. For OP_CLASS they don't match, whereas for OP_NCLASS they do. For classes containing characters with values > 255, OP_XCLASS is used. It optionally uses a bit map (if any characters lie within it), followed by a list of pairs and single characters. There is a flag character than indicates whether it's a positive or a negative class. Back references --------------- OP_REF is followed by two bytes containing the reference number. Repeating character classes and back references ----------------------------------------------- Single-character classes are handled specially (see above). This applies to OP_CLASS and OP_REF. In both cases, the repeat information follows the base item. The matching code looks at the following opcode to see if it is one of OP_CRSTAR OP_CRMINSTAR OP_CRPLUS OP_CRMINPLUS OP_CRQUERY OP_CRMINQUERY OP_CRRANGE OP_CRMINRANGE All but the last two are just single-byte items. The others are followed by four bytes of data, comprising the minimum and maximum repeat counts. Brackets and alternation ------------------------ A pair of non-capturing (round) brackets is wrapped round each expression at compile time, so alternation always happens in the context of brackets. Non-capturing brackets use the opcode OP_BRA, while capturing brackets use OP_BRA+1, OP_BRA+2, etc. [Note for North Americans: "bracket" to some English speakers, including myself, can be round, square, curly, or pointy. Hence this usage.] Originally PCRE was limited to 99 capturing brackets (so as not to use up all the opcodes). From release 3.5, there is no limit. What happens is that the first ones, up to EXTRACT_BASIC_MAX are handled with separate opcodes, as above. If there are more, the opcode is set to EXTRACT_BASIC_MAX+1, and the first operation in the bracket is OP_BRANUMBER, followed by a 2-byte bracket number. This opcode is ignored while matching, but is fished out when handling the bracket itself. (They could have all been done like this, but I was making minimal changes.) A bracket opcode is followed by two bytes which give the offset to the next alternative OP_ALT or, if there aren't any branches, to the matching KET opcode. Each OP_ALT is followed by two bytes giving the offset to the next one, or to the KET opcode. OP_KET is used for subpatterns that do not repeat indefinitely, while OP_KETRMIN and OP_KETRMAX are used for indefinite repetitions, minimally or maximally respectively. All three are followed by two bytes giving (as a positive number) the offset back to the matching BRA opcode. If a subpattern is quantified such that it is permitted to match zero times, it is preceded by one of OP_BRAZERO or OP_BRAMINZERO. These are single-byte opcodes which tell the matcher that skipping this subpattern entirely is a valid branch. A subpattern with an indefinite maximum repetition is replicated in the compiled data its minimum number of times (or once with a BRAZERO if the minimum is zero), with the final copy terminating with a KETRMIN or KETRMAX as appropriate. A subpattern with a bounded maximum repetition is replicated in a nested fashion up to the maximum number of times, with BRAZERO or BRAMINZERO before each replication after the minimum, so that, for example, (abc){2,5} is compiled as (abc)(abc)((abc)((abc)(abc)?)?)?. The 99 and 200 bracket limits do not apply to these internally generated brackets. Assertions ---------- Forward assertions are just like other subpatterns, but starting with one of the opcodes OP_ASSERT or OP_ASSERT_NOT. Backward assertions use the opcodes OP_ASSERTBACK and OP_ASSERTBACK_NOT, and the first opcode inside the assertion is OP_REVERSE, followed by a two byte count of the number of characters to move back the pointer in the subject string. When operating in UTF-8 mode, the count is a character count rather than a byte count. A separate count is present in each alternative of a lookbehind assertion, allowing them to have different fixed lengths. Once-only subpatterns --------------------- These are also just like other subpatterns, but they start with the opcode OP_ONCE. Conditional subpatterns ----------------------- These are like other subpatterns, but they start with the opcode OP_COND. If the condition is a back reference, this is stored at the start of the subpattern using the opcode OP_CREF followed by two bytes containing the reference number. If the condition is "in recursion" (coded as "(?(R)"), the same scheme is used, with a "reference number" of 0xffff. Otherwise, a conditional subpattern always starts with one of the assertions. Recursion --------- Recursion either matches the current regex, or some subexpression. The opcode OP_RECURSE is followed by an value which is the offset to the starting bracket from the start of the whole pattern. Callout ------- OP_CALLOUT is followed by one byte of data that holds a callout number in the range 0 to 255. Changing options ---------------- If any of the /i, /m, or /s options are changed within a pattern, an OP_OPT opcode is compiled, followed by one byte containing the new settings of these flags. If there are several alternatives, there is an occurrence of OP_OPT at the start of all those following the first options change, to set appropriate options for the start of the alternative. Immediately after the end of the group there is another such item to reset the flags to their previous values. A change of flag right at the very start of the pattern can be handled entirely at compile time, and so does not cause anything to be put into the compiled data. Philip Hazel August 2003 0707010003ebd0000041ed0000000a0000000a00000002402cbe23000000000000008800000005000000000000000000000018ff350892reloc/doc/pcre/doc/html0707010003ebd1000081a40000000a0000000a00000001402cbd6400000ee60000008800000005000000000000000000000023ff350897reloc/doc/pcre/doc/html/index.html PCRE specification

Perl-compatible Regular Expressions (PCRE)

The HTML documentation for PCRE comprises the following pages:

pcre   Introductory page
pcreapi   PCRE's native API
pcrebuild   Options for building PCRE
pcrecallout   The callout facility
pcrecompat   Compability with Perl
pcregrep   The pcregrep command
pcrepattern   Regular expressions supported by PCRE
pcreperform   Some comments on performance
pcreposix   The POSIX API to the PCRE library
pcresample   Description of the sample program
pcretest   The pcretest command for testing PCRE

There are also individual pages that summarize the interface for each function in the library:

pcre_compile   Compile a regular expression
pcre_config   Show build-time configuration options
pcre_copy_named_substring   Extract named substring into given buffer
pcre_copy_substring   Extract numbered substring into given buffer
pcre_exec   Match a compiled pattern to a subject string
pcre_free_substring   Free extracted substring
pcre_free_substring_list   Free list of extracted substrings
pcre_fullinfo   Extract information about a pattern
pcre_get_named_substring   Extract named substring into new memory
pcre_get_stringnumber   Convert captured string name to number
pcre_get_substring   Extract numbered substring into new memory
pcre_get_substring_list   Extract all substrings into new memory
pcre_info   Obsolete information extraction function
pcre_maketables   Build character tables in current locale
pcre_study   Study a compiled pattern
pcre_version   Return PCRE version and release date
0707010003ebd2000081a40000000a0000000a00000001402cbd6400001ebd0000008800000005000000000000000000000022ff350897reloc/doc/pcre/doc/html/pcre.html pcre specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

DESCRIPTION

The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl, with just a few differences. The current implementation of PCRE (release 4.x) corresponds approximately with Perl 5.8, including support for UTF-8 encoded strings. However, this support has to be explicitly enabled; it is not the default.

PCRE is written in C and released as a C library. However, a number of people have written wrappers and interfaces of various kinds. A C++ class is included in these contributions, which can be found in the Contrib directory at the primary FTP site, which is:

ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre

Details of exactly which Perl regular expression features are and are not supported by PCRE are given in separate documents. See the pcrepattern and pcrecompat pages.

Some features of PCRE can be included, excluded, or changed when the library is built. The pcre_config() function makes it possible for a client to discover which features are available. Documentation about building PCRE for various operating systems can be found in the README file in the source distribution.


USER DOCUMENTATION

The user documentation for PCRE has been split up into a number of different sections. In the "man" format, each of these is a separate "man page". In the HTML format, each is a separate page, linked from the index page. In the plain text format, all the sections are concatenated, for ease of searching. The sections are as follows:

  pcre              this document
  pcreapi           details of PCRE's native API
  pcrebuild         options for building PCRE
  pcrecallout       details of the callout feature
  pcrecompat        discussion of Perl compatibility
  pcregrep          description of the pcregrep command
  pcrepattern       syntax and semantics of supported
                      regular expressions
  pcreperform       discussion of performance issues
  pcreposix         the POSIX-compatible API
  pcresample        discussion of the sample program
  pcretest          the pcretest testing command

In addition, in the "man" and HTML formats, there is a short page for each library function, listing its arguments and results.


LIMITATIONS

There are some size limitations in PCRE but it is hoped that they will never in practice be relevant.

The maximum length of a compiled pattern is 65539 (sic) bytes if PCRE is compiled with the default internal linkage size of 2. If you want to process regular expressions that are truly enormous, you can compile PCRE with an internal linkage size of 3 or 4 (see the README file in the source distribution and the pcrebuild documentation for details). If these cases the limit is substantially larger. However, the speed of execution will be slower.

All values in repeating quantifiers must be less than 65536. The maximum number of capturing subpatterns is 65535.

There is no limit to the number of non-capturing subpatterns, but the maximum depth of nesting of all kinds of parenthesized subpattern, including capturing subpatterns, assertions, and other types of subpattern, is 200.

The maximum length of a subject string is the largest positive number that an integer variable can hold. However, PCRE uses recursion to handle subpatterns and indefinite repetition. This means that the available stack space may limit the size of a subject string that can be processed by certain patterns.


UTF-8 SUPPORT

Starting at release 3.3, PCRE has had some support for character strings encoded in the UTF-8 format. For release 4.0 this has been greatly extended to cover most common requirements.

In order process UTF-8 strings, you must build PCRE to include UTF-8 support in the code, and, in addition, you must call pcre_compile() with the PCRE_UTF8 option flag. When you do this, both the pattern and any subject strings that are matched against it are treated as UTF-8 strings instead of just strings of bytes.

If you compile PCRE with UTF-8 support, but do not use it at run time, the library will be a bit bigger, but the additional run time overhead is limited to testing the PCRE_UTF8 flag in several places, so should not be very large.

The following comments apply when PCRE is running in UTF-8 mode:

1. When you set the PCRE_UTF8 flag, the strings passed as patterns and subjects are checked for validity on entry to the relevant functions. If an invalid UTF-8 string is passed, an error return is given. In some situations, you may already know that your strings are valid, and therefore want to skip these checks in order to improve performance. If you set the PCRE_NO_UTF8_CHECK flag at compile time or at run time, PCRE assumes that the pattern or subject it is given (respectively) contains only valid UTF-8 codes. In this case, it does not diagnose an invalid UTF-8 string. If you pass an invalid UTF-8 string to PCRE when PCRE_NO_UTF8_CHECK is set, the results are undefined. Your program may crash.

2. In a pattern, the escape sequence \x{...}, where the contents of the braces is a string of hexadecimal digits, is interpreted as a UTF-8 character whose code number is the given hexadecimal number, for example: \x{1234}. If a non-hexadecimal digit appears between the braces, the item is not recognized. This escape sequence can be used either as a literal, or within a character class.

3. The original hexadecimal escape sequence, \xhh, matches a two-byte UTF-8 character if the value is greater than 127.

4. Repeat quantifiers apply to complete UTF-8 characters, not to individual bytes, for example: \x{100}{3}.

5. The dot metacharacter matches one UTF-8 character instead of a single byte.

6. The escape sequence \C can be used to match a single byte in UTF-8 mode, but its use can lead to some strange effects.

7. The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly test characters of any code value, but the characters that PCRE recognizes as digits, spaces, or word characters remain the same set as before, all with values less than 256.

8. Case-insensitive matching applies only to characters whose values are less than 256. PCRE does not support the notion of "case" for higher-valued characters.

9. PCRE does not support the use of Unicode tables and properties or the Perl escapes \p, \P, and \X.


AUTHOR

Philip Hazel <ph10@cam.ac.uk>
University Computing Service,
Cambridge CB2 3QG, England.
Phone: +44 1223 334714

Last updated: 20 August 2003
Copyright © 1997-2003 University of Cambridge. 0707010003ebd3000081a40000000a0000000a00000001402cbd6500000902000000880000000500000000000000000000002aff350897reloc/doc/pcre/doc/html/pcre_compile.html pcre_compile specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

pcre *pcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr);


DESCRIPTION

This function compiles a regular expression into an internal form. Its arguments are:

  pattern       A zero-terminated string containing the
                  regular expression to be compiled
  options       Zero or more option bits
  errptr        Where to put an error message
  erroffset     Offset in pattern where error was found
  tableptr      Pointer to character tables, or NULL to
                  use the built-in default

The option bits are:

  PCRE_ANCHORED         Force pattern anchoring
  PCRE_CASELESS         Do caseless matching
  PCRE_DOLLAR_ENDONLY   $ not to match newline at end
  PCRE_DOTALL           . matches anything including NL
  PCRE_EXTENDED         Ignore whitespace and # comments
  PCRE_EXTRA            PCRE extra features
                          (not much use currently)
  PCRE_MULTILINE        ^ and $ match newlines within data
  PCRE_NO_AUTO_CAPTURE  Disable numbered capturing paren-
                          theses (named ones available)
  PCRE_UNGREEDY         Invert greediness of quantifiers
  PCRE_UTF8             Run in UTF-8 mode
  PCRE_NO_UTF8_CHECK    Do not check the pattern for UTF-8
                          validity (only relevant if
                          PCRE_UTF8 is set)

PCRE must be compiled with UTF-8 support in order to use PCRE_UTF8 (or PCRE_NO_UTF8_CHECK).

The yield of the function is a pointer to a private data structure that contains the compiled pattern, or NULL if an error was detected.

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebd4000081a40000000a0000000a00000001402cbd65000006910000008800000005000000000000000000000029ff350897reloc/doc/pcre/doc/html/pcre_config.html pcre_config specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

int pcre_config(int what, void *where);


DESCRIPTION

This function makes it possible for a client program to find out which optional features are available in the version of the PCRE library it is using. Its arguments are as follows:

  what     A code specifying what information is required
  where    Points to where to put the data

The available codes are:

  PCRE_CONFIG_LINK_SIZE     Internal link size: 2, 3, or 4
  PCRE_CONFIG_MATCH_LIMIT   Internal resource limit
  PCRE_CONFIG_NEWLINE       Value of the newline character
  PCRE_CONFIG_POSIX_MALLOC_THRESHOLD
                            Threshold of return slots, above
                              which malloc() is used by
                              the POSIX API
  PCRE_CONFIG_STACKRECURSE  Recursion implementation (1=stack 0=heap)
  PCRE_CONFIG_UTF8          Availability of UTF-8 support (1=yes 0=no)

The function yields 0 on success or PCRE_ERROR_BADOPTION otherwise.

There is a complete description of the PCRE native API in the pcreapi page, and a description of the POSIX API in the pcreposix page. 0707010003ebd5000081a40000000a0000000a00000001402cbd65000005de0000008800000005000000000000000000000037ff350897reloc/doc/pcre/doc/html/pcre_copy_named_substring.html pcre_copy_named_substring specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

int pcre_copy_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int buffersize);


DESCRIPTION

This is a convenience function for extracting a captured substring, identified by name, into a given buffer. The arguments are:

  code          Pattern that was successfully matched
  subject       Subject that has been successfully matched
  ovector       Offset vector that pcre_exec() used
  stringcount   Value returned by pcre_exec()
  stringname    Name of the required substring
  buffer        Buffer to receive the string
  buffersize    Size of buffer

The yield is the length of the substring, PCRE_ERROR_NOMEMORY if the buffer was too small, or PCRE_ERROR_NOSUBSTRING if the string name is invalid.

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebd6000081a40000000a0000000a00000001402cbd650000055b0000008800000005000000000000000000000031ff350897reloc/doc/pcre/doc/html/pcre_copy_substring.html pcre_copy_substring specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

int pcre_copy_substring(const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int buffersize);


DESCRIPTION

This is a convenience function for extracting a captured substring into a given buffer. The arguments are:

  subject       Subject that has been successfully matched
  ovector       Offset vector that pcre_exec() used
  stringcount   Value returned by pcre_exec()
  stringnumber  Number of the required substring
  buffer        Buffer to receive the string
  buffersize    Size of buffer

The yield is the legnth of the string, PCRE_ERROR_NOMEMORY if the buffer was too small, or PCRE_ERROR_NOSUBSTRING if the string number is invalid.

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebd7000081a40000000a0000000a00000001402cbd650000077a0000008800000005000000000000000000000027ff350897reloc/doc/pcre/doc/html/pcre_exec.html pcre_exec specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

int pcre_exec(const pcre *code, const pcre_extra *extra, const char *subject, int length, int startoffset, int options, int *ovector, int ovecsize);


DESCRIPTION

This function matches a compiled regular expression against a given subject string, and returns offsets to capturing subexpressions. Its arguments are:

  code         Points to the compiled pattern
  extra        Points to an associated pcre_extra structure,
                 or is NULL
  subject      Points to the subject string
  length       Length of the subject string, in bytes
  startoffset  Offset in bytes in the subject at which to
                 start matching
  options      Option bits
  ovector      Points to a vector of ints for result offsets
  ovecsize     Size of the vector (a multiple of 3)

The options are:

  PCRE_ANCHORED      Match only at the first position
  PCRE_NOTBOL        Subject is not the beginning of a line
  PCRE_NOTEOL        Subject is not the end of a line
  PCRE_NOTEMPTY      An empty string is not a valid match
  PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8
                       validity (only relevant if PCRE_UTF8
                       was set at compile time)

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebd8000081a40000000a0000000a00000001402cbd65000003330000008800000005000000000000000000000031ff350897reloc/doc/pcre/doc/html/pcre_free_substring.html pcre_free_substring specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

void pcre_free_substring(const char *stringptr);


DESCRIPTION

This is a convenience function for freeing the store obtained by a previous call to pcre_get_substring() or pcre_get_named_substring(). Its only argument is a pointer to the string.

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebd9000081a40000000a0000000a00000001402cbd650000032f0000008800000005000000000000000000000036ff350897reloc/doc/pcre/doc/html/pcre_free_substring_list.html pcre_free_substring_list specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

void pcre_free_substring_list(const char **stringptr);


DESCRIPTION

This is a convenience function for freeing the store obtained by a previous call to pcre_get_substring_list(). Its only argument is a pointer to the list of string pointers.

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebda000081a40000000a0000000a00000001402cbd6500000832000000880000000500000000000000000000002bff350897reloc/doc/pcre/doc/html/pcre_fullinfo.html pcre_fullinfo specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

int pcre_fullinfo(const pcre *code, const pcre_extra *extra, int what, void *where);


DESCRIPTION

This function returns information about a compiled pattern. Its arguments are:

  code    Compiled regular expression
  extra   Result of pcre_study() or NULL
  what    What information is required
  where   Where to put the information

The following information is available:

  PCRE_INFO_BACKREFMAX     Number of highest back reference
  PCRE_INFO_CAPTURECOUNT   Number of capturing subpatterns
  PCRE_INFO_FIRSTBYTE      Fixed first byte for a match, or
                             -1 for start of string
                                or after newline, or
                             -2 otherwise
  PCRE_INFO_FIRSTTABLE     Table of first bytes
                             (after studying)
  PCRE_INFO_LASTLITERAL    Literal last byte required
  PCRE_INFO_NAMECOUNT      Number of named subpatterns
  PCRE_INFO_NAMEENTRYSIZE  Size of name table entry
  PCRE_INFO_NAMETABLE      Pointer to name table
  PCRE_INFO_OPTIONS        Options used for compilation
  PCRE_INFO_SIZE           Size of compiled pattern

The yield of the function is zero on success or:

  PCRE_ERROR_NULL       the argument code was NULL
                        the argument where was NULL
  PCRE_ERROR_BADMAGIC   the "magic number" was not found
  PCRE_ERROR_BADOPTION  the value of what was invalid

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebdb000081a40000000a0000000a00000001402cbd650000058f0000008800000005000000000000000000000036ff350897reloc/doc/pcre/doc/html/pcre_get_named_substring.html pcre_get_named_substring specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

int pcre_get_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, const char **stringptr);


DESCRIPTION

This is a convenience function for extracting a captured substring by name. The arguments are:

  code          Compiled pattern
  subject       Subject that has been successfully matched
  ovector       Offset vector that pcre_exec() used
  stringcount   Value returned by pcre_exec()
  stringname    Name of the required substring
  stringptr     Where to put the string pointer

The yield is the length of the extracted substring, PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or PCRE_ERROR_NOSUBSTRING if the string name is invalid.

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebdc000081a40000000a0000000a00000001402cbd65000003fe0000008800000005000000000000000000000033ff350897reloc/doc/pcre/doc/html/pcre_get_stringnumber.html pcre_get_stringnumber specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

int pcre_get_stringnumber(const pcre *code, const char *name);


DESCRIPTION

This convenience function finds the number of a named substring capturing parenthesis in a compiled pattern. Its arguments are:

  code    Compiled regular expression
  name    Name whose number is required

The yield of the function is the number of the parenthesis if the name is found, or PCRE_ERROR_NOSUBSTRING otherwise.

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebdd000081a40000000a0000000a00000001402cbd65000005270000008800000005000000000000000000000030ff350897reloc/doc/pcre/doc/html/pcre_get_substring.html pcre_get_substring specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

int pcre_get_substring(const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr);


DESCRIPTION

This is a convenience function for extracting a captured substring. The arguments are:

  subject       Subject that has been successfully matched
  ovector       Offset vector that pcre_exec() used
  stringcount   Value returned by pcre_exec()
  stringnumber  Number of the required substring
  stringptr     Where to put the string pointer

The yield is the length of the substring, PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or PCRE_ERROR_NOSUBSTRING if the string number is invalid.

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebde000081a40000000a0000000a00000001402cbd65000004a30000008800000005000000000000000000000035ff350897reloc/doc/pcre/doc/html/pcre_get_substring_list.html pcre_get_substring_list specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

int pcre_get_substring_list(const char *subject, int *ovector, int stringcount, const char ***listptr);


DESCRIPTION

This is a convenience function for extracting a list of all the captured substrings. The arguments are:

  subject       Subject that has been successfully matched
  ovector       Offset vector that pcre_exec used
  stringcount   Value returned by pcre_exec
  listptr       Where to put a pointer to the list

The yield is zero on success or PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained.

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebdf000081a40000000a0000000a00000001402cbd65000002d90000008800000005000000000000000000000027ff350897reloc/doc/pcre/doc/html/pcre_info.html pcre_info specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

int pcre_info(const pcre *code, int *optptr, int *firstcharptr);


DESCRIPTION

This function is obsolete. You should be using pcre_fullinfo() instead.

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebe0000081a40000000a0000000a00000001402cbd650000039d000000880000000500000000000000000000002dff350897reloc/doc/pcre/doc/html/pcre_maketables.html pcre_maketables specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

const unsigned char *pcre_maketables(void);


DESCRIPTION

This function builds a set of character tables which can be passed to pcre_compile() to override PCRE's internal, built-in tables (which were made by pcre_maketables() when PCRE was compiled). You might want to do this if you are using a non-standard locale. The function yields a pointer to the tables.

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebe1000081a40000000a0000000a00000001402cbd65000005020000008800000005000000000000000000000028ff350897reloc/doc/pcre/doc/html/pcre_study.html pcre_study specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

pcre_extra *pcre_study(const pcre *code, int options, const char **errptr);


DESCRIPTION

This function studies a compiled pattern, to see if additional information can be extracted that might speed up matching. Its arguments are:

  code       A compiled regular expression
  options    Options for pcre_study()
  errptr     Where to put an error message

If the function returns NULL, either it could not find any additional information, or there was an error. You can tell the difference by looking at the error value. It is NULL in first case.

There are currently no options defined; the value of the second argument should always be zero.

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebe2000081a40000000a0000000a00000001402cbd65000002bf000000880000000500000000000000000000002aff350897reloc/doc/pcre/doc/html/pcre_version.html pcre_version specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.

SYNOPSIS

#include <pcre.h>

char *pcre_version(void);


DESCRIPTION

This function returns a character string that gives the version number of the PCRE library, and its date of release.

There is a complete description of the PCRE API in the pcreapi page. 0707010003ebe3000081a40000000a0000000a00000001402cbd650000c8000000008800000005000000000000000000000025ff350897reloc/doc/pcre/doc/html/pcreapi.html pcreapi specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.


SYNOPSIS OF PCRE API

#include <pcre.h>

pcre *pcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr);

pcre_extra *pcre_study(const pcre *code, int options, const char **errptr);

int pcre_exec(const pcre *code, const pcre_extra *extra, const char *subject, int length, int startoffset, int options, int *ovector, int ovecsize);

int pcre_copy_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int buffersize);

int pcre_copy_substring(const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int buffersize);

int pcre_get_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, const char **stringptr);

int pcre_get_stringnumber(const pcre *code, const char *name);

int pcre_get_substring(const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr);

int pcre_get_substring_list(const char *subject, int *ovector, int stringcount, const char ***listptr);

void pcre_free_substring(const char *stringptr);

void pcre_free_substring_list(const char **stringptr);

const unsigned char *pcre_maketables(void);

int pcre_fullinfo(const pcre *code, const pcre_extra *extra, int what, void *where);

int pcre_info(const pcre *code, int *optptr, int *firstcharptr);

int pcre_config(int what, void *where);

char *pcre_version(void);

void *(*pcre_malloc)(size_t);

void (*pcre_free)(void *);

void *(*pcre_stack_malloc)(size_t);

void (*pcre_stack_free)(void *);

int (*pcre_callout)(pcre_callout_block *);


PCRE API

PCRE has its own native API, which is described in this document. There is also a set of wrapper functions that correspond to the POSIX regular expression API. These are described in the pcreposix documentation.

The native API function prototypes are defined in the header file pcre.h, and on Unix systems the library itself is called libpcre.a, so can be accessed by adding -lpcre to the command for linking an application which calls it. The header file defines the macros PCRE_MAJOR and PCRE_MINOR to contain the major and minor release numbers for the library. Applications can use these to include support for different releases.

The functions pcre_compile(), pcre_study(), and pcre_exec() are used for compiling and matching regular expressions. A sample program that demonstrates the simplest way of using them is given in the file pcredemo.c. The pcresample documentation describes how to run it.

There are convenience functions for extracting captured substrings from a matched subject string. They are:

  pcre_copy_substring()
  pcre_copy_named_substring()
  pcre_get_substring()
  pcre_get_named_substring()
  pcre_get_substring_list()

pcre_free_substring() and pcre_free_substring_list() are also provided, to free the memory used for extracted strings.

The function pcre_maketables() is used (optionally) to build a set of character tables in the current locale for passing to pcre_compile().

The function pcre_fullinfo() is used to find out information about a compiled pattern; pcre_info() is an obsolete version which returns only some of the available information, but is retained for backwards compatibility. The function pcre_version() returns a pointer to a string containing the version of PCRE and its date of release.

The global variables pcre_malloc and pcre_free initially contain the entry points of the standard malloc() and free() functions respectively. PCRE calls the memory management functions via these variables, so a calling program can replace them if it wishes to intercept the calls. This should be done before calling any PCRE functions.

The global variables pcre_stack_malloc and pcre_stack_free are also indirections to memory management functions. These special functions are used only when PCRE is compiled to use the heap for remembering data, instead of recursive function calls. This is a non-standard way of building PCRE, for use in environments that have limited stacks. Because of the greater use of memory management, it runs more slowly. Separate functions are provided so that special-purpose external code can be used for this case. When used, these functions are always called in a stack-like manner (last obtained, first freed), and always for memory blocks of the same size.

The global variable pcre_callout initially contains NULL. It can be set by the caller to a "callout" function, which PCRE will then call at specified points during a matching operation. Details are given in the pcrecallout documentation.


MULTITHREADING

The PCRE functions can be used in multi-threading applications, with the proviso that the memory management functions pointed to by pcre_malloc, pcre_free, pcre_stack_malloc, and pcre_stack_free, and the callout function pointed to by pcre_callout, are shared by all threads.

The compiled form of a regular expression is not altered during matching, so the same compiled pattern can safely be used by several threads at once.


CHECKING BUILD-TIME OPTIONS

int pcre_config(int what, void *where);

The function pcre_config() makes it possible for a PCRE client to discover which optional features have been compiled into the PCRE library. The pcrebuild documentation has more details about these optional features.

The first argument for pcre_config() is an integer, specifying which information is required; the second argument is a pointer to a variable into which the information is placed. The following information is available:

  PCRE_CONFIG_UTF8

The output is an integer that is set to one if UTF-8 support is available; otherwise it is set to zero.

  PCRE_CONFIG_NEWLINE

The output is an integer that is set to the value of the code that is used for the newline character. It is either linefeed (10) or carriage return (13), and should normally be the standard character for your operating system.

  PCRE_CONFIG_LINK_SIZE

The output is an integer that contains the number of bytes used for internal linkage in compiled regular expressions. The value is 2, 3, or 4. Larger values allow larger regular expressions to be compiled, at the expense of slower matching. The default value of 2 is sufficient for all but the most massive patterns, since it allows the compiled pattern to be up to 64K in size.

  PCRE_CONFIG_POSIX_MALLOC_THRESHOLD

The output is an integer that contains the threshold above which the POSIX interface uses malloc() for output vectors. Further details are given in the pcreposix documentation.

  PCRE_CONFIG_MATCH_LIMIT

The output is an integer that gives the default limit for the number of internal matching function calls in a pcre_exec() execution. Further details are given with pcre_exec() below.

  PCRE_CONFIG_STACKRECURSE

The output is an integer that is set to one if internal recursion is implemented by recursive function calls that use the stack to remember their state. This is the usual way that PCRE is compiled. The output is zero if PCRE was compiled to use blocks of data on the heap instead of recursive function calls. In this case, pcre_stack_malloc and pcre_stack_free are called to manage memory blocks on the heap, thus avoiding the use of the stack.


COMPILING A PATTERN

pcre *pcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr);

The function pcre_compile() is called to compile a pattern into an internal form. The pattern is a C string terminated by a binary zero, and is passed in the argument pattern. A pointer to a single block of memory that is obtained via pcre_malloc is returned. This contains the compiled code and related data. The pcre type is defined for the returned block; this is a typedef for a structure whose contents are not externally defined. It is up to the caller to free the memory when it is no longer required.

Although the compiled code of a PCRE regex is relocatable, that is, it does not depend on memory location, the complete pcre data block is not fully relocatable, because it contains a copy of the tableptr argument, which is an address (see below).

The options argument contains independent bits that affect the compilation. It should be zero if no options are required. Some of the options, in particular, those that are compatible with Perl, can also be set and unset from within the pattern (see the detailed description of regular expressions in the pcrepattern documentation). For these options, the contents of the options argument specifies their initial settings at the start of compilation and execution. The PCRE_ANCHORED option can be set at the time of matching as well as at compile time.

If errptr is NULL, pcre_compile() returns NULL immediately. Otherwise, if compilation of a pattern fails, pcre_compile() returns NULL, and sets the variable pointed to by errptr to point to a textual error message. The offset from the start of the pattern to the character where the error was discovered is placed in the variable pointed to by erroffset, which must not be NULL. If it is, an immediate error is given.

If the final argument, tableptr, is NULL, PCRE uses a default set of character tables which are built when it is compiled, using the default C locale. Otherwise, tableptr must be the result of a call to pcre_maketables(). See the section on locale support below.

This code fragment shows a typical straightforward call to pcre_compile():

  pcre *re;
  const char *error;
  int erroffset;
  re = pcre_compile(
    "^A.*Z",          /* the pattern */
    0,                /* default options */
    &error,           /* for error message */
    &erroffset,       /* for error offset */
    NULL);            /* use default character tables */

The following option bits are defined:

  PCRE_ANCHORED

If this bit is set, the pattern is forced to be "anchored", that is, it is constrained to match only at the first matching point in the string which is being searched (the "subject string"). This effect can also be achieved by appropriate constructs in the pattern itself, which is the only way to do it in Perl.

  PCRE_CASELESS

If this bit is set, letters in the pattern match both upper and lower case letters. It is equivalent to Perl's /i option, and it can be changed within a pattern by a (?i) option setting.

  PCRE_DOLLAR_ENDONLY

If this bit is set, a dollar metacharacter in the pattern matches only at the end of the subject string. Without this option, a dollar also matches immediately before the final character if it is a newline (but not before any other newlines). The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is set. There is no equivalent to this option in Perl, and no way to set it within a pattern.

  PCRE_DOTALL

If this bit is set, a dot metacharater in the pattern matches all characters, including newlines. Without it, newlines are excluded. This option is equivalent to Perl's /s option, and it can be changed within a pattern by a (?s) option setting. A negative class such as [^a] always matches a newline character, independent of the setting of this option.

  PCRE_EXTENDED

If this bit is set, whitespace data characters in the pattern are totally ignored except when escaped or inside a character class. Whitespace does not include the VT character (code 11). In addition, characters between an unescaped # outside a character class and the next newline character, inclusive, are also ignored. This is equivalent to Perl's /x option, and it can be changed within a pattern by a (?x) option setting.

This option makes it possible to include comments inside complicated patterns. Note, however, that this applies only to data characters. Whitespace characters may never appear within special character sequences in a pattern, for example within the sequence (?( which introduces a conditional subpattern.

  PCRE_EXTRA

This option was invented in order to turn on additional functionality of PCRE that is incompatible with Perl, but it is currently of very little use. When set, any backslash in a pattern that is followed by a letter that has no special meaning causes an error, thus reserving these combinations for future expansion. By default, as in Perl, a backslash followed by a letter with no special meaning is treated as a literal. There are at present no other features controlled by this option. It can also be set by a (?X) option setting within a pattern.

  PCRE_MULTILINE

By default, PCRE treats the subject string as consisting of a single "line" of characters (even if it actually contains several newlines). The "start of line" metacharacter (^) matches only at the start of the string, while the "end of line" metacharacter ($) matches only at the end of the string, or before a terminating newline (unless PCRE_DOLLAR_ENDONLY is set). This is the same as Perl.

When PCRE_MULTILINE it is set, the "start of line" and "end of line" constructs match immediately following or immediately before any newline in the subject string, respectively, as well as at the very start and end. This is equivalent to Perl's /m option, and it can be changed within a pattern by a (?m) option setting. If there are no "\n" characters in a subject string, or no occurrences of ^ or $ in a pattern, setting PCRE_MULTILINE has no effect.

  PCRE_NO_AUTO_CAPTURE

If this option is set, it disables the use of numbered capturing parentheses in the pattern. Any opening parenthesis that is not followed by ? behaves as if it were followed by ?: but named parentheses can still be used for capturing (and they acquire numbers in the usual way). There is no equivalent of this option in Perl.

  PCRE_UNGREEDY

This option inverts the "greediness" of the quantifiers so that they are not greedy by default, but become greedy if followed by "?". It is not compatible with Perl. It can also be set by a (?U) option setting within the pattern.

  PCRE_UTF8

This option causes PCRE to regard both the pattern and the subject as strings of UTF-8 characters instead of single-byte character strings. However, it is available only if PCRE has been built to include UTF-8 support. If not, the use of this option provokes an error. Details of how this option changes the behaviour of PCRE are given in the section on UTF-8 support in the main pcre page.

  PCRE_NO_UTF8_CHECK

When PCRE_UTF8 is set, the validity of the pattern as a UTF-8 string is automatically checked. If an invalid UTF-8 sequence of bytes is found, pcre_compile() returns an error. If you already know that your pattern is valid, and you want to skip this check for performance reasons, you can set the PCRE_NO_UTF8_CHECK option. When it is set, the effect of passing an invalid UTF-8 string as a pattern is undefined. It may cause your program to crash. Note that there is a similar option for suppressing the checking of subject strings passed to pcre_exec().


STUDYING A PATTERN

pcre_extra *pcre_study(const pcre *code, int options, const char **errptr);

When a pattern is going to be used several times, it is worth spending more time analyzing it in order to speed up the time taken for matching. The function pcre_study() takes a pointer to a compiled pattern as its first argument. If studing the pattern produces additional information that will help speed up matching, pcre_study() returns a pointer to a pcre_extra block, in which the study_data field points to the results of the study.

The returned value from a pcre_study() can be passed directly to pcre_exec(). However, the pcre_extra block also contains other fields that can be set by the caller before the block is passed; these are described below. If studying the pattern does not produce any additional information, pcre_study() returns NULL. In that circumstance, if the calling program wants to pass some of the other fields to pcre_exec(), it must set up its own pcre_extra block.

The second argument contains option bits. At present, no options are defined for pcre_study(), and this argument should always be zero.

The third argument for pcre_study() is a pointer for an error message. If studying succeeds (even if no data is returned), the variable it points to is set to NULL. Otherwise it points to a textual error message. You should therefore test the error pointer for NULL after calling pcre_study(), to be sure that it has run successfully.

This is a typical call to pcre_study():

  pcre_extra *pe;
  pe = pcre_study(
    re,             /* result of pcre_compile() */
    0,              /* no options exist */
    &error);        /* set to NULL or points to a message */

At present, studying a pattern is useful only for non-anchored patterns that do not have a single fixed starting character. A bitmap of possible starting characters is created.


LOCALE SUPPORT

PCRE handles caseless matching, and determines whether characters are letters, digits, or whatever, by reference to a set of tables. When running in UTF-8 mode, this applies only to characters with codes less than 256. The library contains a default set of tables that is created in the default C locale when PCRE is compiled. This is used when the final argument of pcre_compile() is NULL, and is sufficient for many applications.

An alternative set of tables can, however, be supplied. Such tables are built by calling the pcre_maketables() function, which has no arguments, in the relevant locale. The result can then be passed to pcre_compile() as often as necessary. For example, to build and use tables that are appropriate for the French locale (where accented characters with codes greater than 128 are treated as letters), the following code could be used:

  setlocale(LC_CTYPE, "fr");
  tables = pcre_maketables();
  re = pcre_compile(..., tables);

The tables are built in memory that is obtained via pcre_malloc. The pointer that is passed to pcre_compile is saved with the compiled pattern, and the same tables are used via this pointer by pcre_study() and pcre_exec(). Thus, for any single pattern, compilation, studying and matching all happen in the same locale, but different patterns can be compiled in different locales. It is the caller's responsibility to ensure that the memory containing the tables remains available for as long as it is needed.


INFORMATION ABOUT A PATTERN

int pcre_fullinfo(const pcre *code, const pcre_extra *extra, int what, void *where);

The pcre_fullinfo() function returns information about a compiled pattern. It replaces the obsolete pcre_info() function, which is nevertheless retained for backwards compability (and is documented below).

The first argument for pcre_fullinfo() is a pointer to the compiled pattern. The second argument is the result of pcre_study(), or NULL if the pattern was not studied. The third argument specifies which piece of information is required, and the fourth argument is a pointer to a variable to receive the data. The yield of the function is zero for success, or one of the following negative numbers:

  PCRE_ERROR_NULL       the argument code was NULL
                        the argument where was NULL
  PCRE_ERROR_BADMAGIC   the "magic number" was not found
  PCRE_ERROR_BADOPTION  the value of what was invalid

Here is a typical call of pcre_fullinfo(), to obtain the length of the compiled pattern:

  int rc;
  unsigned long int length;
  rc = pcre_fullinfo(
    re,               /* result of pcre_compile() */
    pe,               /* result of pcre_study(), or NULL */
    PCRE_INFO_SIZE,   /* what is required */
    &length);         /* where to put the data */

The possible values for the third argument are defined in pcre.h, and are as follows:

  PCRE_INFO_BACKREFMAX

Return the number of the highest back reference in the pattern. The fourth argument should point to an int variable. Zero is returned if there are no back references.

  PCRE_INFO_CAPTURECOUNT

Return the number of capturing subpatterns in the pattern. The fourth argument should point to an \fbint\fR variable.

  PCRE_INFO_FIRSTBYTE

Return information about the first byte of any matched string, for a non-anchored pattern. (This option used to be called PCRE_INFO_FIRSTCHAR; the old name is still recognized for backwards compatibility.)

If there is a fixed first byte, e.g. from a pattern such as (cat|cow|coyote), it is returned in the integer pointed to by where. Otherwise, if either

(a) the pattern was compiled with the PCRE_MULTILINE option, and every branch starts with "^", or

(b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set (if it were set, the pattern would be anchored),

-1 is returned, indicating that the pattern matches only at the start of a subject string or after any newline within the string. Otherwise -2 is returned. For anchored patterns, -2 is returned.

  PCRE_INFO_FIRSTTABLE

If the pattern was studied, and this resulted in the construction of a 256-bit table indicating a fixed set of bytes for the first byte in any matching string, a pointer to the table is returned. Otherwise NULL is returned. The fourth argument should point to an unsigned char * variable.

  PCRE_INFO_LASTLITERAL

Return the value of the rightmost literal byte that must exist in any matched string, other than at its start, if such a byte has been recorded. The fourth argument should point to an int variable. If there is no such byte, -1 is returned. For anchored patterns, a last literal byte is recorded only if it follows something of variable length. For example, for the pattern /^a\d+z\d+/ the returned value is "z", but for /^a\dz\d/ the returned value is -1.

  PCRE_INFO_NAMECOUNT
  PCRE_INFO_NAMEENTRYSIZE
  PCRE_INFO_NAMETABLE

PCRE supports the use of named as well as numbered capturing parentheses. The names are just an additional way of identifying the parentheses, which still acquire a number. A caller that wants to extract data from a named subpattern must convert the name to a number in order to access the correct pointers in the output vector (described with pcre_exec() below). In order to do this, it must first use these three values to obtain the name-to-number mapping table for the pattern.

The map consists of a number of fixed-size entries. PCRE_INFO_NAMECOUNT gives the number of entries, and PCRE_INFO_NAMEENTRYSIZE gives the size of each entry; both of these return an int value. The entry size depends on the length of the longest name. PCRE_INFO_NAMETABLE returns a pointer to the first entry of the table (a pointer to char). The first two bytes of each entry are the number of the capturing parenthesis, most significant byte first. The rest of the entry is the corresponding name, zero terminated. The names are in alphabetical order. For example, consider the following pattern (assume PCRE_EXTENDED is set, so white space - including newlines - is ignored):

  (?P<date> (?P<year>(\d\d)?\d\d) -
  (?P<month>\d\d) - (?P<day>\d\d) )

There are four named subpatterns, so the table has four entries, and each entry in the table is eight bytes long. The table is as follows, with non-printing bytes shows in hex, and undefined bytes shown as ??:

  00 01 d  a  t  e  00 ??
  00 05 d  a  y  00 ?? ??
  00 04 m  o  n  t  h  00
  00 02 y  e  a  r  00 ??

When writing code to extract data from named subpatterns, remember that the length of each entry may be different for each compiled pattern.

  PCRE_INFO_OPTIONS

Return a copy of the options with which the pattern was compiled. The fourth argument should point to an unsigned long int variable. These option bits are those specified in the call to pcre_compile(), modified by any top-level option settings within the pattern itself.

A pattern is automatically anchored by PCRE if all of its top-level alternatives begin with one of the following:

  ^     unless PCRE_MULTILINE is set
  \A    always
  \G    always
  .*    if PCRE_DOTALL is set and there are no back
          references to the subpattern in which .* appears

For such patterns, the PCRE_ANCHORED bit is set in the options returned by pcre_fullinfo().

  PCRE_INFO_SIZE

Return the size of the compiled pattern, that is, the value that was passed as the argument to pcre_malloc() when PCRE was getting memory in which to place the compiled data. The fourth argument should point to a size_t variable.

  PCRE_INFO_STUDYSIZE

Returns the size of the data block pointed to by the study_data field in a pcre_extra block. That is, it is the value that was passed to pcre_malloc() when PCRE was getting memory into which to place the data created by pcre_study(). The fourth argument should point to a size_t variable.


OBSOLETE INFO FUNCTION

int pcre_info(const pcre *code, int *optptr, int *firstcharptr);

The pcre_info() function is now obsolete because its interface is too restrictive to return all the available data about a compiled pattern. New programs should use pcre_fullinfo() instead. The yield of pcre_info() is the number of capturing subpatterns, or one of the following negative numbers:

  PCRE_ERROR_NULL       the argument code was NULL
  PCRE_ERROR_BADMAGIC   the "magic number" was not found

If the optptr argument is not NULL, a copy of the options with which the pattern was compiled is placed in the integer it points to (see PCRE_INFO_OPTIONS above).

If the pattern is not anchored and the firstcharptr argument is not NULL, it is used to pass back information about the first character of any matched string (see PCRE_INFO_FIRSTBYTE above).


MATCHING A PATTERN

int pcre_exec(const pcre *code, const pcre_extra *extra, const char *subject, int length, int startoffset, int options, int *ovector, int ovecsize);

The function pcre_exec() is called to match a subject string against a pre-compiled pattern, which is passed in the code argument. If the pattern has been studied, the result of the study should be passed in the extra argument.

Here is an example of a simple call to pcre_exec():

  int rc;
  int ovector[30];
  rc = pcre_exec(
    re,             /* result of pcre_compile() */
    NULL,           /* we didn't study the pattern */
    "some string",  /* the subject string */
    11,             /* the length of the subject string */
    0,              /* start at offset 0 in the subject */
    0,              /* default options */
    ovector,        /* vector for substring information */
    30);            /* number of elements in the vector */

If the extra argument is not NULL, it must point to a pcre_extra data block. The pcre_study() function returns such a block (when it doesn't return NULL), but you can also create one for yourself, and pass additional information in it. The fields in the block are as follows:

  unsigned long int flags;
  void *study_data;
  unsigned long int match_limit;
  void *callout_data;

The flags field is a bitmap that specifies which of the other fields are set. The flag bits are:

  PCRE_EXTRA_STUDY_DATA
  PCRE_EXTRA_MATCH_LIMIT
  PCRE_EXTRA_CALLOUT_DATA

Other flag bits should be set to zero. The study_data field is set in the pcre_extra block that is returned by pcre_study(), together with the appropriate flag bit. You should not set this yourself, but you can add to the block by setting the other fields.

The match_limit field provides a means of preventing PCRE from using up a vast amount of resources when running patterns that are not going to match, but which have a very large number of possibilities in their search trees. The classic example is the use of nested unlimited repeats. Internally, PCRE uses a function called match() which it calls repeatedly (sometimes recursively). The limit is imposed on the number of times this function is called during a match, which has the effect of limiting the amount of recursion and backtracking that can take place. For patterns that are not anchored, the count starts from zero for each position in the subject string.

The default limit for the library can be set when PCRE is built; the default default is 10 million, which handles all but the most extreme cases. You can reduce the default by suppling pcre_exec() with a \fRpcre_extra\fR block in which match_limit is set to a smaller value, and PCRE_EXTRA_MATCH_LIMIT is set in the flags field. If the limit is exceeded, pcre_exec() returns PCRE_ERROR_MATCHLIMIT.

The pcre_callout field is used in conjunction with the "callout" feature, which is described in the pcrecallout documentation.

The PCRE_ANCHORED option can be passed in the options argument, whose unused bits must be zero. This limits pcre_exec() to matching at the first matching position. However, if a pattern was compiled with PCRE_ANCHORED, or turned out to be anchored by virtue of its contents, it cannot be made unachored at matching time.

When PCRE_UTF8 was set at compile time, the validity of the subject as a UTF-8 string is automatically checked, and the value of startoffset is also checked to ensure that it points to the start of a UTF-8 character. If an invalid UTF-8 sequence of bytes is found, pcre_exec() returns the error PCRE_ERROR_BADUTF8. If startoffset contains an invalid value, PCRE_ERROR_BADUTF8_OFFSET is returned.

If you already know that your subject is valid, and you want to skip these checks for performance reasons, you can set the PCRE_NO_UTF8_CHECK option when calling pcre_exec(). You might want to do this for the second and subsequent calls to pcre_exec() if you are making repeated calls to find all the matches in a single subject string. However, you should be sure that the value of startoffset points to the start of a UTF-8 character. When PCRE_NO_UTF8_CHECK is set, the effect of passing an invalid UTF-8 string as a subject, or a value of startoffset that does not point to the start of a UTF-8 character, is undefined. Your program may crash.

There are also three further options that can be set only at matching time:

  PCRE_NOTBOL

The first character of the string is not the beginning of a line, so the circumflex metacharacter should not match before it. Setting this without PCRE_MULTILINE (at compile time) causes circumflex never to match.

  PCRE_NOTEOL

The end of the string is not the end of a line, so the dollar metacharacter should not match it nor (except in multiline mode) a newline immediately before it. Setting this without PCRE_MULTILINE (at compile time) causes dollar never to match.

  PCRE_NOTEMPTY

An empty string is not considered to be a valid match if this option is set. If there are alternatives in the pattern, they are tried. If all the alternatives match the empty string, the entire match fails. For example, if the pattern

  a?b?

is applied to a string not beginning with "a" or "b", it matches the empty string at the start of the subject. With PCRE_NOTEMPTY set, this match is not valid, so PCRE searches further into the string for occurrences of "a" or "b".

Perl has no direct equivalent of PCRE_NOTEMPTY, but it does make a special case of a pattern match of the empty string within its split() function, and when using the /g modifier. It is possible to emulate Perl's behaviour after matching a null string by first trying the match again at the same offset with PCRE_NOTEMPTY set, and then if that fails by advancing the starting offset (see below) and trying an ordinary match again.

The subject string is passed to pcre_exec() as a pointer in subject, a length in length, and a starting byte offset in startoffset. Unlike the pattern string, the subject may contain binary zero bytes. When the starting offset is zero, the search for a match starts at the beginning of the subject, and this is by far the most common case.

If the pattern was compiled with the PCRE_UTF8 option, the subject must be a sequence of bytes that is a valid UTF-8 string, and the starting offset must point to the beginning of a UTF-8 character. If an invalid UTF-8 string or offset is passed, an error (either PCRE_ERROR_BADUTF8 or PCRE_ERROR_BADUTF8_OFFSET) is returned, unless the option PCRE_NO_UTF8_CHECK is set, in which case PCRE's behaviour is not defined.

A non-zero starting offset is useful when searching for another match in the same subject by calling pcre_exec() again after a previous success. Setting startoffset differs from just passing over a shortened string and setting PCRE_NOTBOL in the case of a pattern that begins with any kind of lookbehind. For example, consider the pattern

  \Biss\B

which finds occurrences of "iss" in the middle of words. (\B matches only if the current position in the subject is not a word boundary.) When applied to the string "Mississipi" the first call to pcre_exec() finds the first occurrence. If pcre_exec() is called again with just the remainder of the subject, namely "issipi", it does not match, because \B is always false at the start of the subject, which is deemed to be a word boundary. However, if pcre_exec() is passed the entire string again, but with startoffset set to 4, it finds the second occurrence of "iss" because it is able to look behind the starting point to discover that it is preceded by a letter.

If a non-zero starting offset is passed when the pattern is anchored, one attempt to match at the given offset is tried. This can only succeed if the pattern does not require the match to be at the start of the subject.

In general, a pattern matches a certain portion of the subject, and in addition, further substrings from the subject may be picked out by parts of the pattern. Following the usage in Jeffrey Friedl's book, this is called "capturing" in what follows, and the phrase "capturing subpattern" is used for a fragment of a pattern that picks out a substring. PCRE supports several other kinds of parenthesized subpattern that do not cause substrings to be captured.

Captured substrings are returned to the caller via a vector of integer offsets whose address is passed in ovector. The number of elements in the vector is passed in ovecsize. The first two-thirds of the vector is used to pass back captured substrings, each substring using a pair of integers. The remaining third of the vector is used as workspace by pcre_exec() while matching capturing subpatterns, and is not available for passing back information. The length passed in ovecsize should always be a multiple of three. If it is not, it is rounded down.

When a match has been successful, information about captured substrings is returned in pairs of integers, starting at the beginning of ovector, and continuing up to two-thirds of its length at the most. The first element of a pair is set to the offset of the first character in a substring, and the second is set to the offset of the first character after the end of a substring. The first pair, ovector[0] and ovector[1], identify the portion of the subject string matched by the entire pattern. The next pair is used for the first capturing subpattern, and so on. The value returned by pcre_exec() is the number of pairs that have been set. If there are no capturing subpatterns, the return value from a successful match is 1, indicating that just the first pair of offsets has been set.

Some convenience functions are provided for extracting the captured substrings as separate strings. These are described in the following section.

It is possible for an capturing subpattern number n+1 to match some part of the subject when subpattern n has not been used at all. For example, if the string "abc" is matched against the pattern (a|(z))(bc) subpatterns 1 and 3 are matched, but 2 is not. When this happens, both offset values corresponding to the unused subpattern are set to -1.

If a capturing subpattern is matched repeatedly, it is the last portion of the string that it matched that gets returned.

If the vector is too small to hold all the captured substrings, it is used as far as possible (up to two-thirds of its length), and the function returns a value of zero. In particular, if the substring offsets are not of interest, pcre_exec() may be called with ovector passed as NULL and ovecsize as zero. However, if the pattern contains back references and the ovector isn't big enough to remember the related substrings, PCRE has to get additional memory for use during matching. Thus it is usually advisable to supply an ovector.

Note that pcre_info() can be used to find out how many capturing subpatterns there are in a compiled pattern. The smallest size for ovector that will allow for n captured substrings, in addition to the offsets of the substring matched by the whole pattern, is (n+1)*3.

If pcre_exec() fails, it returns a negative number. The following are defined in the header file:

  PCRE_ERROR_NOMATCH        (-1)

The subject string did not match the pattern.

  PCRE_ERROR_NULL           (-2)

Either code or subject was passed as NULL, or ovector was NULL and ovecsize was not zero.

  PCRE_ERROR_BADOPTION      (-3)

An unrecognized bit was set in the options argument.

  PCRE_ERROR_BADMAGIC       (-4)

PCRE stores a 4-byte "magic number" at the start of the compiled code, to catch the case when it is passed a junk pointer. This is the error it gives when the magic number isn't present.

  PCRE_ERROR_UNKNOWN_NODE   (-5)

While running the pattern match, an unknown item was encountered in the compiled pattern. This error could be caused by a bug in PCRE or by overwriting of the compiled pattern.

  PCRE_ERROR_NOMEMORY       (-6)

If a pattern contains back references, but the ovector that is passed to pcre_exec() is not big enough to remember the referenced substrings, PCRE gets a block of memory at the start of matching to use for this purpose. If the call via pcre_malloc() fails, this error is given. The memory is freed at the end of matching.

  PCRE_ERROR_NOSUBSTRING    (-7)

This error is used by the pcre_copy_substring(), pcre_get_substring(), and pcre_get_substring_list() functions (see below). It is never returned by pcre_exec().

  PCRE_ERROR_MATCHLIMIT     (-8)

The recursion and backtracking limit, as specified by the match_limit field in a pcre_extra structure (or defaulted) was reached. See the description above.

  PCRE_ERROR_CALLOUT        (-9)

This error is never generated by pcre_exec() itself. It is provided for use by callout functions that want to yield a distinctive error code. See the pcrecallout documentation for details.

  PCRE_ERROR_BADUTF8        (-10)

A string that contains an invalid UTF-8 byte sequence was passed as a subject.

  PCRE_ERROR_BADUTF8_OFFSET (-11)

The UTF-8 byte sequence that was passed as a subject was valid, but the value of startoffset did not point to the beginning of a UTF-8 character.


EXTRACTING CAPTURED SUBSTRINGS BY NUMBER

int pcre_copy_substring(const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int buffersize);

int pcre_get_substring(const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr);

int pcre_get_substring_list(const char *subject, int *ovector, int stringcount, const char ***listptr);

Captured substrings can be accessed directly by using the offsets returned by pcre_exec() in ovector. For convenience, the functions pcre_copy_substring(), pcre_get_substring(), and pcre_get_substring_list() are provided for extracting captured substrings as new, separate, zero-terminated strings. These functions identify substrings by number. The next section describes functions for extracting named substrings. A substring that contains a binary zero is correctly extracted and has a further zero added on the end, but the result is not, of course, a C string.

The first three arguments are the same for all three of these functions: subject is the subject string which has just been successfully matched, ovector is a pointer to the vector of integer offsets that was passed to pcre_exec(), and stringcount is the number of substrings that were captured by the match, including the substring that matched the entire regular expression. This is the value returned by pcre_exec if it is greater than zero. If pcre_exec() returned zero, indicating that it ran out of space in ovector, the value passed as stringcount should be the size of the vector divided by three.

The functions pcre_copy_substring() and pcre_get_substring() extract a single substring, whose number is given as stringnumber. A value of zero extracts the substring that matched the entire pattern, while higher values extract the captured substrings. For pcre_copy_substring(), the string is placed in buffer, whose length is given by buffersize, while for pcre_get_substring() a new block of memory is obtained via pcre_malloc, and its address is returned via stringptr. The yield of the function is the length of the string, not including the terminating zero, or one of

  PCRE_ERROR_NOMEMORY       (-6)

The buffer was too small for pcre_copy_substring(), or the attempt to get memory failed for pcre_get_substring().

  PCRE_ERROR_NOSUBSTRING    (-7)

There is no substring whose number is stringnumber.

The pcre_get_substring_list() function extracts all available substrings and builds a list of pointers to them. All this is done in a single block of memory which is obtained via pcre_malloc. The address of the memory block is returned via listptr, which is also the start of the list of string pointers. The end of the list is marked by a NULL pointer. The yield of the function is zero if all went well, or

  PCRE_ERROR_NOMEMORY       (-6)

if the attempt to get the memory block failed.

When any of these functions encounter a substring that is unset, which can happen when capturing subpattern number n+1 matches some part of the subject, but subpattern n has not been used at all, they return an empty string. This can be distinguished from a genuine zero-length substring by inspecting the appropriate offset in ovector, which is negative for unset substrings.

The two convenience functions pcre_free_substring() and pcre_free_substring_list() can be used to free the memory returned by a previous call of pcre_get_substring() or pcre_get_substring_list(), respectively. They do nothing more than call the function pointed to by pcre_free, which of course could be called directly from a C program. However, PCRE is used in some situations where it is linked via a special interface to another programming language which cannot use pcre_free directly; it is for these cases that the functions are provided.


EXTRACTING CAPTURED SUBSTRINGS BY NAME

int pcre_copy_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int buffersize);

int pcre_get_stringnumber(const pcre *code, const char *name);

int pcre_get_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, const char **stringptr);

To extract a substring by name, you first have to find associated number. This can be done by calling pcre_get_stringnumber(). The first argument is the compiled pattern, and the second is the name. For example, for this pattern

  ab(?<xxx>\d+)...

the number of the subpattern called "xxx" is 1. Given the number, you can then extract the substring directly, or use one of the functions described in the previous section. For convenience, there are also two functions that do the whole job.

Most of the arguments of pcre_copy_named_substring() and pcre_get_named_substring() are the same as those for the functions that extract by number, and so are not re-described here. There are just two differences.

First, instead of a substring number, a substring name is given. Second, there is an extra argument, given at the start, which is a pointer to the compiled pattern. This is needed in order to gain access to the name-to-number translation table.

These functions call pcre_get_stringnumber(), and if it succeeds, they then call pcre_copy_substring() or pcre_get_substring(), as appropriate.

Last updated: 09 December 2003
Copyright © 1997-2003 University of Cambridge. 0707010003ebe4000081a40000000a0000000a00000001402cbd6500001ba60000008800000005000000000000000000000027ff350897reloc/doc/pcre/doc/html/pcrebuild.html pcrebuild specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.


PCRE BUILD-TIME OPTIONS

This document describes the optional features of PCRE that can be selected when the library is compiled. They are all selected, or deselected, by providing options to the configure script which is run before the make command. The complete list of options for configure (which includes the standard ones such as the selection of the installation directory) can be obtained by running

  ./configure --help

The following sections describe certain options whose names begin with --enable or --disable. These settings specify changes to the defaults for the configure command. Because of the way that configure works, --enable and --disable always come in pairs, so the complementary option always exists as well, but as it specifies the default, it is not described.


UTF-8 SUPPORT

To build PCRE with support for UTF-8 character strings, add

  --enable-utf8

to the configure command. Of itself, this does not make PCRE treat strings as UTF-8. As well as compiling PCRE with this option, you also have have to set the PCRE_UTF8 option when you call the pcre_compile() function.


CODE VALUE OF NEWLINE

By default, PCRE treats character 10 (linefeed) as the newline character. This is the normal newline character on Unix-like systems. You can compile PCRE to use character 13 (carriage return) instead by adding

  --enable-newline-is-cr

to the configure command. For completeness there is also a --enable-newline-is-lf option, which explicitly specifies linefeed as the newline character.


BUILDING SHARED AND STATIC LIBRARIES

The PCRE building process uses libtool to build both shared and static Unix libraries by default. You can suppress one of these by adding one of

  --disable-shared
  --disable-static

to the configure command, as required.


POSIX MALLOC USAGE

When PCRE is called through the POSIX interface (see the pcreposix documentation), additional working storage is required for holding the pointers to capturing substrings because PCRE requires three integers per substring, whereas the POSIX interface provides only two. If the number of expected substrings is small, the wrapper function uses space on the stack, because this is faster than using malloc() for each call. The default threshold above which the stack is no longer used is 10; it can be changed by adding a setting such as

  --with-posix-malloc-threshold=20

to the configure command.


LIMITING PCRE RESOURCE USAGE

Internally, PCRE has a function called match() which it calls repeatedly (possibly recursively) when performing a matching operation. By limiting the number of times this function may be called, a limit can be placed on the resources used by a single call to pcre_exec(). The limit can be changed at run time, as described in the pcreapi documentation. The default is 10 million, but this can be changed by adding a setting such as

  --with-match-limit=500000

to the configure command.


HANDLING VERY LARGE PATTERNS

Within a compiled pattern, offset values are used to point from one part to another (for example, from an opening parenthesis to an alternation metacharacter). By default two-byte values are used for these offsets, leading to a maximum size for a compiled pattern of around 64K. This is sufficient to handle all but the most gigantic patterns. Nevertheless, some people do want to process enormous patterns, so it is possible to compile PCRE to use three-byte or four-byte offsets by adding a setting such as

  --with-link-size=3

to the configure command. The value given must be 2, 3, or 4. Using longer offsets slows down the operation of PCRE because it has to load additional bytes when handling them.

If you build PCRE with an increased link size, test 2 (and test 5 if you are using UTF-8) will fail. Part of the output of these tests is a representation of the compiled pattern, and this changes with the link size.


AVOIDING EXCESSIVE STACK USAGE

PCRE implements backtracking while matching by making recursive calls to an internal function called match(). In environments where the size of the stack is limited, this can severely limit PCRE's operation. (The Unix environment does not usually suffer from this problem.) An alternative approach that uses memory from the heap to remember data, instead of using recursive function calls, has been implemented to work round this problem. If you want to build a version of PCRE that works this way, add

  --disable-stack-for-recursion

to the configure command. With this configuration, PCRE will use the pcre_stack_malloc and pcre_stack_free variables to call memory management functions. Separate functions are provided because the usage is very predictable: the block sizes requested are always the same, and the blocks are always freed in reverse order. A calling program might be able to implement optimized functions that perform better than the standard malloc() and free() functions. PCRE runs noticeably more slowly when built in this way.


USING EBCDIC CODE

PCRE assumes by default that it will run in an environment where the character code is ASCII (or UTF-8, which is a superset of ASCII). PCRE can, however, be compiled to run in an EBCDIC environment by adding

  --enable-ebcdic

to the configure command.

Last updated: 09 December 2003
Copyright © 1997-2003 University of Cambridge. 0707010003ebe5000081a40000000a0000000a00000001402cbd65000011ca0000008800000005000000000000000000000029ff350897reloc/doc/pcre/doc/html/pcrecallout.html pcrecallout specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.


PCRE CALLOUTS

int (*pcre_callout)(pcre_callout_block *);

PCRE provides a feature called "callout", which is a means of temporarily passing control to the caller of PCRE in the middle of pattern matching. The caller of PCRE provides an external function by putting its entry point in the global variable pcre_callout. By default, this variable contains NULL, which disables all calling out.

Within a regular expression, (?C) indicates the points at which the external function is to be called. Different callout points can be identified by putting a number less than 256 after the letter C. The default value is zero. For example, this pattern has two callout points:

  (?C1)\dabc(?C2)def

During matching, when PCRE reaches a callout point (and pcre_callout is set), the external function is called. Its only argument is a pointer to a pcre_callout block. This contains the following variables:

  int          version;
  int          callout_number;
  int         *offset_vector;
  const char  *subject;
  int          subject_length;
  int          start_match;
  int          current_position;
  int          capture_top;
  int          capture_last;
  void        *callout_data;

The version field is an integer containing the version number of the block format. The current version is zero. The version number may change in future if additional fields are added, but the intention is never to remove any of the existing fields.

The callout_number field contains the number of the callout, as compiled into the pattern (that is, the number after ?C).

The offset_vector field is a pointer to the vector of offsets that was passed by the caller to pcre_exec(). The contents can be inspected in order to extract substrings that have been matched so far, in the same way as for extracting substrings after a match has completed.

The subject and subject_length fields contain copies the values that were passed to pcre_exec().

The start_match field contains the offset within the subject at which the current match attempt started. If the pattern is not anchored, the callout function may be called several times for different starting points.

The current_position field contains the offset within the subject of the current match pointer.

The capture_top field contains one more than the number of the highest numbered captured substring so far. If no substrings have been captured, the value of capture_top is one.

The capture_last field contains the number of the most recently captured substring.

The callout_data field contains a value that is passed to pcre_exec() by the caller specifically so that it can be passed back in callouts. It is passed in the pcre_callout field of the pcre_extra data structure. If no such data was passed, the value of callout_data in a pcre_callout block is NULL. There is a description of the pcre_extra structure in the pcreapi documentation.


RETURN VALUES

The callout function returns an integer. If the value is zero, matching proceeds as normal. If the value is greater than zero, matching fails at the current point, but backtracking to test other possibilities goes ahead, just as if a lookahead assertion had failed. If the value is less than zero, the match is abandoned, and pcre_exec() returns the value.

Negative values should normally be chosen from the set of PCRE_ERROR_xxx values. In particular, PCRE_ERROR_NOMATCH forces a standard "no match" failure. The error number PCRE_ERROR_CALLOUT is reserved for use by callout functions; it will never be used by PCRE itself.

Last updated: 21 January 2003
Copyright © 1997-2003 University of Cambridge. 0707010003ebe6000081a40000000a0000000a00000001402cbd65000013360000008800000005000000000000000000000028ff350897reloc/doc/pcre/doc/html/pcrecompat.html pcrecompat specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.


DIFFERENCES FROM PERL

This document describes the differences in the ways that PCRE and Perl handle regular expressions. The differences described here are with respect to Perl 5.8.

1. PCRE does not have full UTF-8 support. Details of what it does have are given in the section on UTF-8 support in the main pcre page.

2. PCRE does not allow repeat quantifiers on lookahead assertions. Perl permits them, but they do not mean what you might think. For example, (?!a){3} does not assert that the next three characters are not "a". It just asserts that the next character is not "a" three times.

3. Capturing subpatterns that occur inside negative lookahead assertions are counted, but their entries in the offsets vector are never set. Perl sets its numerical variables from any such patterns that are matched before the assertion fails to match something (thereby succeeding), but only if the negative lookahead assertion contains just one branch.

4. Though binary zero characters are supported in the subject string, they are not allowed in a pattern string because it is passed as a normal C string, terminated by zero. The escape sequence "\0" can be used in the pattern to represent a binary zero.

5. The following Perl escape sequences are not supported: \l, \u, \L, \U, \P, \p, \N, and \X. In fact these are implemented by Perl's general string-handling and are not part of its pattern matching engine. If any of these are encountered by PCRE, an error is generated.

6. PCRE does support the \Q...\E escape for quoting substrings. Characters in between are treated as literals. This is slightly different from Perl in that $ and @ are also handled as literals inside the quotes. In Perl, they cause variable interpolation (but of course PCRE does not have variables). Note the following examples:

    Pattern            PCRE matches      Perl matches

    \Qabc$xyz\E        abc$xyz           abc followed by the
                                           contents of $xyz
    \Qabc\$xyz\E       abc\$xyz          abc\$xyz
    \Qabc\E\$\Qxyz\E   abc$xyz           abc$xyz

The \Q...\E sequence is recognized both inside and outside character classes.

7. Fairly obviously, PCRE does not support the (?{code}) and (?p{code}) constructions. However, there is some experimental support for recursive patterns using the non-Perl items (?R), (?number) and (?P>name). Also, the PCRE "callout" feature allows an external function to be called during pattern matching.

8. There are some differences that are concerned with the settings of captured strings when part of a pattern is repeated. For example, matching "aba" against the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE it is set to "b".

9. PCRE provides some extensions to the Perl regular expression facilities:

(a) Although lookbehind assertions must match fixed length strings, each alternative branch of a lookbehind assertion can match a different length of string. Perl requires them all to have the same length.

(b) If PCRE_DOLLAR_ENDONLY is set and PCRE_MULTILINE is not set, the $ meta-character matches only at the very end of the string.

© If PCRE_EXTRA is set, a backslash followed by a letter with no special meaning is faulted.

(d) If PCRE_UNGREEDY is set, the greediness of the repetition quantifiers is inverted, that is, by default they are not greedy, but if followed by a question mark they are.

(e) PCRE_ANCHORED can be used to force a pattern to be tried only at the first matching position in the subject string.

(f) The PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, and PCRE_NO_AUTO_CAPTURE options for pcre_exec() have no Perl equivalents.

(g) The (?R), (?number), and (?P>name) constructs allows for recursive pattern matching (Perl can do this using the (?p{code}) construct, which PCRE cannot support.)

(h) PCRE supports named capturing substrings, using the Python syntax.

(i) PCRE supports the possessive quantifier "++" syntax, taken from Sun's Java package.

(j) The (R) condition, for testing recursion, is a PCRE extension.

(k) The callout facility is PCRE-specific.

Last updated: 09 December 2003
Copyright © 1997-2003 University of Cambridge. 0707010003ebe7000081a40000000a0000000a00000001402cbd64000013730000008800000005000000000000000000000026ff350897reloc/doc/pcre/doc/html/pcregrep.html pcregrep specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.


SYNOPSIS

pcregrep [-Vcfhilnrsuvx] [long options] [pattern] [file1 file2 ...]


DESCRIPTION

pcregrep searches files for character patterns, in the same way as other grep commands do, but it uses the PCRE regular expression library to support patterns that are compatible with the regular expressions of Perl 5. See pcrepattern for a full description of syntax and semantics of the regular expressions that PCRE supports.

A pattern must be specified on the command line unless the -f option is used (see below).

If no files are specified, pcregrep reads the standard input. By default, each line that matches the pattern is copied to the standard output, and if there is more than one file, the file name is printed before each line of output. However, there are options that can change how pcregrep behaves.

Lines are limited to BUFSIZ characters. BUFSIZ is defined in <stdio.h>. The newline character is removed from the end of each line before it is matched against the pattern.


OPTIONS

-V Write the version number of the PCRE library being used to the standard error stream.

-c Do not print individual lines; instead just print a count of the number of lines that would otherwise have been printed. If several files are given, a count is printed for each of them.

-ffilename Read a number of patterns from the file, one per line, and match all of them against each line of input. A line is output if any of the patterns match it. When -f is used, no pattern is taken from the command line; all arguments are treated as file names. There is a maximum of 100 patterns. Trailing white space is removed, and blank lines are ignored. An empty file contains no patterns and therefore matches nothing.

-h Suppress printing of filenames when searching multiple files.

-i Ignore upper/lower case distinctions during comparisons.

-l Instead of printing lines from the files, just print the names of the files containing lines that would have been printed. Each file name is printed once, on a separate line.

-n Precede each line by its line number in the file.

-r If any file is a directory, recursively scan the files it contains. Without -r a directory is scanned as a normal file.

-s Work silently, that is, display nothing except error messages. The exit status indicates whether any matches were found.

-u Operate in UTF-8 mode. This option is available only if PCRE has been compiled with UTF-8 support. Both the pattern and each subject line are assumed to be valid strings of UTF-8 characters.

-v Invert the sense of the match, so that lines which do not match the pattern are now the ones that are found.

-x Force the pattern to be anchored (it must start matching at the beginning of the line) and in addition, require it to match the entire line. This is equivalent to having ^ and $ characters at the start and end of each alternative branch in the regular expression.


LONG OPTIONS

Long forms of all the options are available, as in GNU grep. They are shown in the following table:

  -c   --count
  -h   --no-filename
  -i   --ignore-case
  -l   --files-with-matches
  -n   --line-number
  -r   --recursive
  -s   --no-messages
  -u   --utf-8
  -V   --version
  -v   --invert-match
  -x   --line-regex
  -x   --line-regexp

In addition, --file=filename is equivalent to -ffilename, and --help shows the list of options and then exits.


DIAGNOSTICS

Exit status is 0 if any matches were found, 1 if no matches were found, and 2 for syntax errors or inacessible files (even if matches were found).


AUTHOR

Philip Hazel <ph10@cam.ac.uk>
University Computing Service
Cambridge CB2 3QG, England.

Last updated: 03 February 2003
Copyright © 1997-2003 University of Cambridge. 0707010003ebe8000081a40000000a0000000a00000001402cbd650000eba00000008800000005000000000000000000000029ff350897reloc/doc/pcre/doc/html/pcrepattern.html pcrepattern specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.


PCRE REGULAR EXPRESSION DETAILS

The syntax and semantics of the regular expressions supported by PCRE are described below. Regular expressions are also described in the Perl documentation and in a number of other books, some of which have copious examples. Jeffrey Friedl's "Mastering Regular Expressions", published by O'Reilly, covers them in great detail. The description here is intended as reference documentation.

The basic operation of PCRE is on strings of bytes. However, there is also support for UTF-8 character strings. To use this support you must build PCRE to include UTF-8 support, and then call pcre_compile() with the PCRE_UTF8 option. How this affects the pattern matching is mentioned in several places below. There is also a summary of UTF-8 features in the section on UTF-8 support in the main pcre page.

A regular expression is a pattern that is matched against a subject string from left to right. Most characters stand for themselves in a pattern, and match the corresponding characters in the subject. As a trivial example, the pattern

  The quick brown fox

matches a portion of a subject string that is identical to itself. The power of regular expressions comes from the ability to include alternatives and repetitions in the pattern. These are encoded in the pattern by the use of meta-characters, which do not stand for themselves but instead are interpreted in some special way.

There are two different sets of meta-characters: those that are recognized anywhere in the pattern except within square brackets, and those that are recognized in square brackets. Outside square brackets, the meta-characters are as follows:

  \      general escape character with several uses
  ^      assert start of string (or line, in multiline mode)
  $      assert end of string (or line, in multiline mode)
  .      match any character except newline (by default)
  [      start character class definition
  |      start of alternative branch
  (      start subpattern
  )      end subpattern
  ?      extends the meaning of (
         also 0 or 1 quantifier
         also quantifier minimizer
  *      0 or more quantifier
  +      1 or more quantifier
         also "possessive quantifier"
  {      start min/max quantifier

Part of a pattern that is in square brackets is called a "character class". In a character class the only meta-characters are:

  \      general escape character
  ^      negate the class, but only if the first character
  -      indicates character range
  [      POSIX character class (only if followed by POSIX
           syntax)
  ]      terminates the character class

The following sections describe the use of each of the meta-characters.


BACKSLASH

The backslash character has several uses. Firstly, if it is followed by a non-alphameric character, it takes away any special meaning that character may have. This use of backslash as an escape character applies both inside and outside character classes.

For example, if you want to match a * character, you write \* in the pattern. This escaping action applies whether or not the following character would otherwise be interpreted as a meta-character, so it is always safe to precede a non-alphameric with backslash to specify that it stands for itself. In particular, if you want to match a backslash, you write \\.

If a pattern is compiled with the PCRE_EXTENDED option, whitespace in the pattern (other than in a character class) and characters between a # outside a character class and the next newline character are ignored. An escaping backslash can be used to include a whitespace or # character as part of the pattern.

If you want to remove the special meaning from a sequence of characters, you can do so by putting them between \Q and \E. This is different from Perl in that $ and @ are handled as literals in \Q...\E sequences in PCRE, whereas in Perl, $ and @ cause variable interpolation. Note the following examples:

  Pattern            PCRE matches   Perl matches

  \Qabc$xyz\E        abc$xyz        abc followed by the
                                      contents of $xyz
  \Qabc\$xyz\E       abc\$xyz       abc\$xyz
  \Qabc\E\$\Qxyz\E   abc$xyz        abc$xyz

The \Q...\E sequence is recognized both inside and outside character classes.

A second use of backslash provides a way of encoding non-printing characters in patterns in a visible manner. There is no restriction on the appearance of non-printing characters, apart from the binary zero that terminates a pattern, but when a pattern is being prepared by text editing, it is usually easier to use one of the following escape sequences than the binary character it represents:

  \a        alarm, that is, the BEL character (hex 07)
  \cx       "control-x", where x is any character
  \e        escape (hex 1B)
  \f        formfeed (hex 0C)
  \n        newline (hex 0A)
  \r        carriage return (hex 0D)
  \t        tab (hex 09)
  \ddd      character with octal code ddd, or backreference
  \xhh      character with hex code hh
  \x{hhh..} character with hex code hhh... (UTF-8 mode only)

The precise effect of \cx is as follows: if x is a lower case letter, it is converted to upper case. Then bit 6 of the character (hex 40) is inverted. Thus \cz becomes hex 1A, but \c{ becomes hex 3B, while \c; becomes hex 7B.

After \x, from zero to two hexadecimal digits are read (letters can be in upper or lower case). In UTF-8 mode, any number of hexadecimal digits may appear between \x{ and }, but the value of the character code must be less than 2**31 (that is, the maximum hexadecimal value is 7FFFFFFF). If characters other than hexadecimal digits appear between \x{ and }, or if there is no terminating }, this form of escape is not recognized. Instead, the initial \x will be interpreted as a basic hexadecimal escape, with no following digits, giving a byte whose value is zero.

Characters whose value is less than 256 can be defined by either of the two syntaxes for \x when PCRE is in UTF-8 mode. There is no difference in the way they are handled. For example, \xdc is exactly the same as \x{dc}.

After \0 up to two further octal digits are read. In both cases, if there are fewer than two digits, just those that are present are used. Thus the sequence \0\x\07 specifies two binary zeros followed by a BEL character (code value 7). Make sure you supply two digits after the initial zero if the character that follows is itself an octal digit.

The handling of a backslash followed by a digit other than 0 is complicated. Outside a character class, PCRE reads it and any following digits as a decimal number. If the number is less than 10, or if there have been at least that many previous capturing left parentheses in the expression, the entire sequence is taken as a back reference. A description of how this works is given later, following the discussion of parenthesized subpatterns.

Inside a character class, or if the decimal number is greater than 9 and there have not been that many capturing subpatterns, PCRE re-reads up to three octal digits following the backslash, and generates a single byte from the least significant 8 bits of the value. Any subsequent digits stand for themselves. For example:

  \040   is another way of writing a space
  \40    is the same, provided there are fewer than 40
            previous capturing subpatterns
  \7     is always a back reference
  \11    might be a back reference, or another way of
            writing a tab
  \011   is always a tab
  \0113  is a tab followed by the character "3"
  \113   might be a back reference, otherwise the
            character with octal code 113
  \377   might be a back reference, otherwise
            the byte consisting entirely of 1 bits
  \81    is either a back reference, or a binary zero
            followed by the two characters "8" and "1"

Note that octal values of 100 or greater must not be introduced by a leading zero, because no more than three octal digits are ever read.

All the sequences that define a single byte value or a single UTF-8 character (in UTF-8 mode) can be used both inside and outside character classes. In addition, inside a character class, the sequence \b is interpreted as the backspace character (hex 08). Outside a character class it has a different meaning (see below).

The third use of backslash is for specifying generic character types:

  \d     any decimal digit
  \D     any character that is not a decimal digit
  \s     any whitespace character
  \S     any character that is not a whitespace character
  \w     any "word" character
  \W     any "non-word" character

Each pair of escape sequences partitions the complete set of characters into two disjoint sets. Any given character matches one, and only one, of each pair.

In UTF-8 mode, characters with values greater than 255 never match \d, \s, or \w, and always match \D, \S, and \W.

For compatibility with Perl, \s does not match the VT character (code 11). This makes it different from the the POSIX "space" class. The \s characters are HT (9), LF (10), FF (12), CR (13), and space (32).

A "word" character is any letter or digit or the underscore character, that is, any character which can be part of a Perl "word". The definition of letters and digits is controlled by PCRE's character tables, and may vary if locale- specific matching is taking place (see "Locale support" in the pcreapi page). For example, in the "fr" (French) locale, some character codes greater than 128 are used for accented letters, and these are matched by \w.

These character type sequences can appear both inside and outside character classes. They each match one character of the appropriate type. If the current matching point is at the end of the subject string, all of them fail, since there is no character to match.

The fourth use of backslash is for certain simple assertions. An assertion specifies a condition that has to be met at a particular point in a match, without consuming any characters from the subject string. The use of subpatterns for more complicated assertions is described below. The backslashed assertions are

  \b     matches at a word boundary
  \B     matches when not at a word boundary
  \A     matches at start of subject
  \Z     matches at end of subject or before newline at end
  \z     matches at end of subject
  \G     matches at first matching position in subject

These assertions may not appear in character classes (but note that \b has a different meaning, namely the backspace character, inside a character class).

A word boundary is a position in the subject string where the current character and the previous character do not both match \w or \W (i.e. one matches \w and the other matches \W), or the start or end of the string if the first or last character matches \w, respectively.

The \A, \Z, and \z assertions differ from the traditional circumflex and dollar (described below) in that they only ever match at the very start and end of the subject string, whatever options are set. Thus, they are independent of multiline mode.

They are not affected by the PCRE_NOTBOL or PCRE_NOTEOL options. If the startoffset argument of pcre_exec() is non-zero, indicating that matching is to start at a point other than the beginning of the subject, \A can never match. The difference between \Z and \z is that \Z matches before a newline that is the last character of the string as well as at the end of the string, whereas \z matches only at the end.

The \G assertion is true only when the current matching position is at the start point of the match, as specified by the startoffset argument of pcre_exec(). It differs from \A when the value of startoffset is non-zero. By calling pcre_exec() multiple times with appropriate arguments, you can mimic Perl's /g option, and it is in this kind of implementation where \G can be useful.

Note, however, that PCRE's interpretation of \G, as the start of the current match, is subtly different from Perl's, which defines it as the end of the previous match. In Perl, these can be different when the previously matched string was empty. Because PCRE does just one match at a time, it cannot reproduce this behaviour.

If all the alternatives of a pattern begin with \G, the expression is anchored to the starting match position, and the "anchored" flag is set in the compiled regular expression.


CIRCUMFLEX AND DOLLAR

Outside a character class, in the default matching mode, the circumflex character is an assertion which is true only if the current matching point is at the start of the subject string. If the startoffset argument of pcre_exec() is non-zero, circumflex can never match if the PCRE_MULTILINE option is unset. Inside a character class, circumflex has an entirely different meaning (see below).

Circumflex need not be the first character of the pattern if a number of alternatives are involved, but it should be the first thing in each alternative in which it appears if the pattern is ever to match that branch. If all possible alternatives start with a circumflex, that is, if the pattern is constrained to match only at the start of the subject, it is said to be an "anchored" pattern. (There are also other constructs that can cause a pattern to be anchored.)

A dollar character is an assertion which is true only if the current matching point is at the end of the subject string, or immediately before a newline character that is the last character in the string (by default). Dollar need not be the last character of the pattern if a number of alternatives are involved, but it should be the last item in any branch in which it appears. Dollar has no special meaning in a character class.

The meaning of dollar can be changed so that it matches only at the very end of the string, by setting the PCRE_DOLLAR_ENDONLY option at compile time. This does not affect the \Z assertion.

The meanings of the circumflex and dollar characters are changed if the PCRE_MULTILINE option is set. When this is the case, they match immediately after and immediately before an internal newline character, respectively, in addition to matching at the start and end of the subject string. For example, the pattern /^abc$/ matches the subject string "def\nabc" in multiline mode, but not otherwise. Consequently, patterns that are anchored in single line mode because all branches start with ^ are not anchored in multiline mode, and a match for circumflex is possible when the startoffset argument of pcre_exec() is non-zero. The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is set.

Note that the sequences \A, \Z, and \z can be used to match the start and end of the subject in both modes, and if all branches of a pattern start with \A it is always anchored, whether PCRE_MULTILINE is set or not.


FULL STOP (PERIOD, DOT)

Outside a character class, a dot in the pattern matches any one character in the subject, including a non-printing character, but not (by default) newline. In UTF-8 mode, a dot matches any UTF-8 character, which might be more than one byte long, except (by default) for newline. If the PCRE_DOTALL option is set, dots match newlines as well. The handling of dot is entirely independent of the handling of circumflex and dollar, the only relationship being that they both involve newline characters. Dot has no special meaning in a character class.


MATCHING A SINGLE BYTE

Outside a character class, the escape sequence \C matches any one byte, both in and out of UTF-8 mode. Unlike a dot, it always matches a newline. The feature is provided in Perl in order to match individual bytes in UTF-8 mode. Because it breaks up UTF-8 characters into individual bytes, what remains in the string may be a malformed UTF-8 string. For this reason it is best avoided.

PCRE does not allow \C to appear in lookbehind assertions (see below), because in UTF-8 mode it makes it impossible to calculate the length of the lookbehind.


SQUARE BRACKETS

An opening square bracket introduces a character class, terminated by a closing square bracket. A closing square bracket on its own is not special. If a closing square bracket is required as a member of the class, it should be the first data character in the class (after an initial circumflex, if present) or escaped with a backslash.

A character class matches a single character in the subject. In UTF-8 mode, the character may occupy more than one byte. A matched character must be in the set of characters defined by the class, unless the first character in the class definition is a circumflex, in which case the subject character must not be in the set defined by the class. If a circumflex is actually required as a member of the class, ensure it is not the first character, or escape it with a backslash.

For example, the character class [aeiou] matches any lower case vowel, while [^aeiou] matches any character that is not a lower case vowel. Note that a circumflex is just a convenient notation for specifying the characters which are in the class by enumerating those that are not. It is not an assertion: it still consumes a character from the subject string, and fails if the current pointer is at the end of the string.

In UTF-8 mode, characters with values greater than 255 can be included in a class as a literal string of bytes, or by using the \x{ escaping mechanism.

When caseless matching is set, any letters in a class represent both their upper case and lower case versions, so for example, a caseless [aeiou] matches "A" as well as "a", and a caseless [^aeiou] does not match "A", whereas a caseful version would. PCRE does not support the concept of case for characters with values greater than 255.

The newline character is never treated in any special way in character classes, whatever the setting of the PCRE_DOTALL or PCRE_MULTILINE options is. A class such as [^a] will always match a newline.

The minus (hyphen) character can be used to specify a range of characters in a character class. For example, [d-m] matches any letter between d and m, inclusive. If a minus character is required in a class, it must be escaped with a backslash or appear in a position where it cannot be interpreted as indicating a range, typically as the first or last character in the class.

It is not possible to have the literal character "]" as the end character of a range. A pattern such as [W-]46] is interpreted as a class of two characters ("W" and "-") followed by a literal string "46]", so it would match "W46]" or "-46]". However, if the "]" is escaped with a backslash it is interpreted as the end of range, so [W-\]46] is interpreted as a single class containing a range followed by two separate characters. The octal or hexadecimal representation of "]" can also be used to end a range.

Ranges operate in the collating sequence of character values. They can also be used for characters specified numerically, for example [\000-\037]. In UTF-8 mode, ranges can include characters whose values are greater than 255, for example [\x{100}-\x{2ff}].

If a range that includes letters is used when caseless matching is set, it matches the letters in either case. For example, [W-c] is equivalent to [][\^_`wxyzabc], matched caselessly, and if character tables for the "fr" locale are in use, [\xc8-\xcb] matches accented E characters in both cases.

The character types \d, \D, \s, \S, \w, and \W may also appear in a character class, and add the characters that they match to the class. For example, [\dABCDEF] matches any hexadecimal digit. A circumflex can conveniently be used with the upper case character types to specify a more restricted set of characters than the matching lower case type. For example, the class [^\W_] matches any letter or digit, but not underscore.

All non-alphameric characters other than \, -, ^ (at the start) and the terminating ] are non-special in character classes, but it does no harm if they are escaped.


POSIX CHARACTER CLASSES

Perl supports the POSIX notation for character classes, which uses names enclosed by [: and :] within the enclosing square brackets. PCRE also supports this notation. For example,

  [01[:alpha:]%]

matches "0", "1", any alphabetic character, or "%". The supported class names are

  alnum    letters and digits
  alpha    letters
  ascii    character codes 0 - 127
  blank    space or tab only
  cntrl    control characters
  digit    decimal digits (same as \d)
  graph    printing characters, excluding space
  lower    lower case letters
  print    printing characters, including space
  punct    printing characters, excluding letters and digits
  space    white space (not quite the same as \s)
  upper    upper case letters
  word     "word" characters (same as \w)
  xdigit   hexadecimal digits

The "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), and space (32). Notice that this list includes the VT character (code 11). This makes "space" different to \s, which does not include VT (for Perl compatibility).

The name "word" is a Perl extension, and "blank" is a GNU extension from Perl 5.8. Another Perl extension is negation, which is indicated by a ^ character after the colon. For example,

  [12[:^digit:]]

matches "1", "2", or any non-digit. PCRE (and Perl) also recognize the POSIX syntax [.ch.] and [=ch=] where "ch" is a "collating element", but these are not supported, and an error is given if they are encountered.

In UTF-8 mode, characters with values greater than 255 do not match any of the POSIX character classes.


VERTICAL BAR

Vertical bar characters are used to separate alternative patterns. For example, the pattern

  gilbert|sullivan

matches either "gilbert" or "sullivan". Any number of alternatives may appear, and an empty alternative is permitted (matching the empty string). The matching process tries each alternative in turn, from left to right, and the first one that succeeds is used. If the alternatives are within a subpattern (defined below), "succeeds" means matching the rest of the main pattern as well as the alternative in the subpattern.


INTERNAL OPTION SETTING

The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and PCRE_EXTENDED options can be changed from within the pattern by a sequence of Perl option letters enclosed between "(?" and ")". The option letters are

  i  for PCRE_CASELESS
  m  for PCRE_MULTILINE
  s  for PCRE_DOTALL
  x  for PCRE_EXTENDED

For example, (?im) sets caseless, multiline matching. It is also possible to unset these options by preceding the letter with a hyphen, and a combined setting and unsetting such as (?im-sx), which sets PCRE_CASELESS and PCRE_MULTILINE while unsetting PCRE_DOTALL and PCRE_EXTENDED, is also permitted. If a letter appears both before and after the hyphen, the option is unset.

When an option change occurs at top level (that is, not inside subpattern parentheses), the change applies to the remainder of the pattern that follows. If the change is placed right at the start of a pattern, PCRE extracts it into the global options (and it will therefore show up in data extracted by the pcre_fullinfo() function).

An option change within a subpattern affects only that part of the current pattern that follows it, so

  (a(?i)b)c

matches abc and aBc and no other strings (assuming PCRE_CASELESS is not used). By this means, options can be made to have different settings in different parts of the pattern. Any changes made in one alternative do carry on into subsequent branches within the same subpattern. For example,

  (a(?i)b|c)

matches "ab", "aB", "c", and "C", even though when matching "C" the first branch is abandoned before the option setting. This is because the effects of option settings happen at compile time. There would be some very weird behaviour otherwise.

The PCRE-specific options PCRE_UNGREEDY and PCRE_EXTRA can be changed in the same way as the Perl-compatible options by using the characters U and X respectively. The (?X) flag setting is special in that it must always occur earlier in the pattern than any of the additional features it turns on, even when it is at top level. It is best put at the start.


SUBPATTERNS

Subpatterns are delimited by parentheses (round brackets), which can be nested. Marking part of a pattern as a subpattern does two things:

1. It localizes a set of alternatives. For example, the pattern

  cat(aract|erpillar|)

matches one of the words "cat", "cataract", or "caterpillar". Without the parentheses, it would match "cataract", "erpillar" or the empty string.

2. It sets up the subpattern as a capturing subpattern (as defined above). When the whole pattern matches, that portion of the subject string that matched the subpattern is passed back to the caller via the ovector argument of pcre_exec(). Opening parentheses are counted from left to right (starting from 1) to obtain the numbers of the capturing subpatterns.

For example, if the string "the red king" is matched against the pattern

  the ((red|white) (king|queen))

the captured substrings are "red king", "red", and "king", and are numbered 1, 2, and 3, respectively.

The fact that plain parentheses fulfil two functions is not always helpful. There are often times when a grouping subpattern is required without a capturing requirement. If an opening parenthesis is followed by a question mark and a colon, the subpattern does not do any capturing, and is not counted when computing the number of any subsequent capturing subpatterns. For example, if the string "the white queen" is matched against the pattern

  the ((?:red|white) (king|queen))

the captured substrings are "white queen" and "queen", and are numbered 1 and 2. The maximum number of capturing subpatterns is 65535, and the maximum depth of nesting of all subpatterns, both capturing and non-capturing, is 200.

As a convenient shorthand, if any option settings are required at the start of a non-capturing subpattern, the option letters may appear between the "?" and the ":". Thus the two patterns

  (?i:saturday|sunday)
  (?:(?i)saturday|sunday)

match exactly the same set of strings. Because alternative branches are tried from left to right, and options are not reset until the end of the subpattern is reached, an option setting in one branch does affect subsequent branches, so the above patterns match "SUNDAY" as well as "Saturday".


NAMED SUBPATTERNS

Identifying capturing parentheses by number is simple, but it can be very hard to keep track of the numbers in complicated regular expressions. Furthermore, if an expression is modified, the numbers may change. To help with the difficulty, PCRE supports the naming of subpatterns, something that Perl does not provide. The Python syntax (?P<name>...) is used. Names consist of alphanumeric characters and underscores, and must be unique within a pattern.

Named capturing parentheses are still allocated numbers as well as names. The PCRE API provides function calls for extracting the name-to-number translation table from a compiled pattern. For further details see the pcreapi documentation.


REPETITION

Repetition is specified by quantifiers, which can follow any of the following items:

  a literal data character
  the . metacharacter
  the \C escape sequence
  escapes such as \d that match single characters
  a character class
  a back reference (see next section)
  a parenthesized subpattern (unless it is an assertion)

The general repetition quantifier specifies a minimum and maximum number of permitted matches, by giving the two numbers in curly brackets (braces), separated by a comma. The numbers must be less than 65536, and the first must be less than or equal to the second. For example:

  z{2,4}

matches "zz", "zzz", or "zzzz". A closing brace on its own is not a special character. If the second number is omitted, but the comma is present, there is no upper limit; if the second number and the comma are both omitted, the quantifier specifies an exact number of required matches. Thus

  [aeiou]{3,}

matches at least 3 successive vowels, but may match many more, while

  \d{8}

matches exactly 8 digits. An opening curly bracket that appears in a position where a quantifier is not allowed, or one that does not match the syntax of a quantifier, is taken as a literal character. For example, {,6} is not a quantifier, but a literal string of four characters.

In UTF-8 mode, quantifiers apply to UTF-8 characters rather than to individual bytes. Thus, for example, \x{100}{2} matches two UTF-8 characters, each of which is represented by a two-byte sequence.

The quantifier {0} is permitted, causing the expression to behave as if the previous item and the quantifier were not present.

For convenience (and historical compatibility) the three most common quantifiers have single-character abbreviations:

  *    is equivalent to {0,}
  +    is equivalent to {1,}
  ?    is equivalent to {0,1}

It is possible to construct infinite loops by following a subpattern that can match no characters with a quantifier that has no upper limit, for example:

  (a?)*

Earlier versions of Perl and PCRE used to give an error at compile time for such patterns. However, because there are cases where this can be useful, such patterns are now accepted, but if any repetition of the subpattern does in fact match no characters, the loop is forcibly broken.

By default, the quantifiers are "greedy", that is, they match as much as possible (up to the maximum number of permitted times), without causing the rest of the pattern to fail. The classic example of where this gives problems is in trying to match comments in C programs. These appear between the sequences /* and */ and within the sequence, individual * and / characters may appear. An attempt to match C comments by applying the pattern

  /\*.*\*/

to the string

  /* first command */  not comment  /* second comment */

fails, because it matches the entire string owing to the greediness of the .* item.

However, if a quantifier is followed by a question mark, it ceases to be greedy, and instead matches the minimum number of times possible, so the pattern

  /\*.*?\*/

does the right thing with the C comments. The meaning of the various quantifiers is not otherwise changed, just the preferred number of matches. Do not confuse this use of question mark with its use as a quantifier in its own right. Because it has two uses, it can sometimes appear doubled, as in

  \d??\d

which matches one digit by preference, but can match two if that is the only way the rest of the pattern matches.

If the PCRE_UNGREEDY option is set (an option which is not available in Perl), the quantifiers are not greedy by default, but individual ones can be made greedy by following them with a question mark. In other words, it inverts the default behaviour.

When a parenthesized subpattern is quantified with a minimum repeat count that is greater than 1 or with a limited maximum, more store is required for the compiled pattern, in proportion to the size of the minimum or maximum.

If a pattern starts with .* or .{0,} and the PCRE_DOTALL option (equivalent to Perl's /s) is set, thus allowing the . to match newlines, the pattern is implicitly anchored, because whatever follows will be tried against every character position in the subject string, so there is no point in retrying the overall match at any position after the first. PCRE normally treats such a pattern as though it were preceded by \A.

In cases where it is known that the subject string contains no newlines, it is worth setting PCRE_DOTALL in order to obtain this optimization, or alternatively using ^ to indicate anchoring explicitly.

However, there is one situation where the optimization cannot be used. When .* is inside capturing parentheses that are the subject of a backreference elsewhere in the pattern, a match at the start may fail, and a later one succeed. Consider, for example:

  (.*)abc\1

If the subject is "xyz123abc123" the match point is the fourth character. For this reason, such a pattern is not implicitly anchored.

When a capturing subpattern is repeated, the value captured is the substring that matched the final iteration. For example, after

  (tweedle[dume]{3}\s*)+

has matched "tweedledum tweedledee" the value of the captured substring is "tweedledee". However, if there are nested capturing subpatterns, the corresponding captured values may have been set in previous iterations. For example, after

  /(a|(b))+/

matches "aba" the value of the second captured substring is "b".


ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS

With both maximizing and minimizing repetition, failure of what follows normally causes the repeated item to be re-evaluated to see if a different number of repeats allows the rest of the pattern to match. Sometimes it is useful to prevent this, either to change the nature of the match, or to cause it fail earlier than it otherwise might, when the author of the pattern knows there is no point in carrying on.

Consider, for example, the pattern \d+foo when applied to the subject line

  123456bar

After matching all 6 digits and then failing to match "foo", the normal action of the matcher is to try again with only 5 digits matching the \d+ item, and then with 4, and so on, before ultimately failing. "Atomic grouping" (a term taken from Jeffrey Friedl's book) provides the means for specifying that once a subpattern has matched, it is not to be re-evaluated in this way.

If we use atomic grouping for the previous example, the matcher would give up immediately on failing to match "foo" the first time. The notation is a kind of special parenthesis, starting with (?> as in this example:

  (?>\d+)foo

This kind of parenthesis "locks up" the part of the pattern it contains once it has matched, and a failure further into the pattern is prevented from backtracking into it. Backtracking past it to previous items, however, works as normal.

An alternative description is that a subpattern of this type matches the string of characters that an identical standalone pattern would match, if anchored at the current point in the subject string.

Atomic grouping subpatterns are not capturing subpatterns. Simple cases such as the above example can be thought of as a maximizing repeat that must swallow everything it can. So, while both \d+ and \d+? are prepared to adjust the number of digits they match in order to make the rest of the pattern match, (?>\d+) can only match an entire sequence of digits.

Atomic groups in general can of course contain arbitrarily complicated subpatterns, and can be nested. However, when the subpattern for an atomic group is just a single repeated item, as in the example above, a simpler notation, called a "possessive quantifier" can be used. This consists of an additional + character following a quantifier. Using this notation, the previous example can be rewritten as

  \d++bar

Possessive quantifiers are always greedy; the setting of the PCRE_UNGREEDY option is ignored. They are a convenient notation for the simpler forms of atomic group. However, there is no difference in the meaning or processing of a possessive quantifier and the equivalent atomic group.

The possessive quantifier syntax is an extension to the Perl syntax. It originates in Sun's Java package.

When a pattern contains an unlimited repeat inside a subpattern that can itself be repeated an unlimited number of times, the use of an atomic group is the only way to avoid some failing matches taking a very long time indeed. The pattern

  (\D+|<\d+>)*[!?]

matches an unlimited number of substrings that either consist of non-digits, or digits enclosed in <>, followed by either ! or ?. When it matches, it runs quickly. However, if it is applied to

  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

it takes a long time before reporting failure. This is because the string can be divided between the two repeats in a large number of ways, and all have to be tried. (The example used [!?] rather than a single character at the end, because both PCRE and Perl have an optimization that allows for fast failure when a single character is used. They remember the last single character that is required for a match, and fail early if it is not present in the string.) If the pattern is changed to

  ((?>\D+)|<\d+>)*[!?]

sequences of non-digits cannot be broken, and failure happens quickly.


BACK REFERENCES

Outside a character class, a backslash followed by a digit greater than 0 (and possibly further digits) is a back reference to a capturing subpattern earlier (that is, to its left) in the pattern, provided there have been that many previous capturing left parentheses.

However, if the decimal number following the backslash is less than 10, it is always taken as a back reference, and causes an error only if there are not that many capturing left parentheses in the entire pattern. In other words, the parentheses that are referenced need not be to the left of the reference for numbers less than 10. See the section entitled "Backslash" above for further details of the handling of digits following a backslash.

A back reference matches whatever actually matched the capturing subpattern in the current subject string, rather than anything matching the subpattern itself (see "Subpatterns as subroutines" below for a way of doing that). So the pattern

  (sens|respons)e and \1ibility

matches "sense and sensibility" and "response and responsibility", but not "sense and responsibility". If caseful matching is in force at the time of the back reference, the case of letters is relevant. For example,

  ((?i)rah)\s+\1

matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original capturing subpattern is matched caselessly.

Back references to named subpatterns use the Python syntax (?P=name). We could rewrite the above example as follows:

  (?<p1>(?i)rah)\s+(?P=p1)

There may be more than one back reference to the same subpattern. If a subpattern has not actually been used in a particular match, any back references to it always fail. For example, the pattern

  (a|(bc))\2

always fails if it starts to match "a" rather than "bc". Because there may be many capturing parentheses in a pattern, all digits following the backslash are taken as part of a potential back reference number. If the pattern continues with a digit character, some delimiter must be used to terminate the back reference. If the PCRE_EXTENDED option is set, this can be whitespace. Otherwise an empty comment can be used.

A back reference that occurs inside the parentheses to which it refers fails when the subpattern is first used, so, for example, (a\1) never matches. However, such references can be useful inside repeated subpatterns. For example, the pattern

  (a|b\1)+

matches any number of "a"s and also "aba", "ababbaa" etc. At each iteration of the subpattern, the back reference matches the character string corresponding to the previous iteration. In order for this to work, the pattern must be such that the first iteration does not need to match the back reference. This can be done using alternation, as in the example above, or by a quantifier with a minimum of zero.


ASSERTIONS

An assertion is a test on the characters following or preceding the current matching point that does not actually consume any characters. The simple assertions coded as \b, \B, \A, \G, \Z, \z, ^ and $ are described above. More complicated assertions are coded as subpatterns. There are two kinds: those that look ahead of the current position in the subject string, and those that look behind it.

An assertion subpattern is matched in the normal way, except that it does not cause the current matching position to be changed. Lookahead assertions start with (?= for positive assertions and (?! for negative assertions. For example,

  \w+(?=;)

matches a word followed by a semicolon, but does not include the semicolon in the match, and

  foo(?!bar)

matches any occurrence of "foo" that is not followed by "bar". Note that the apparently similar pattern

  (?!foo)bar

does not find an occurrence of "bar" that is preceded by something other than "foo"; it finds any occurrence of "bar" whatsoever, because the assertion (?!foo) is always true when the next three characters are "bar". A lookbehind assertion is needed to achieve this effect.

If you want to force a matching failure at some point in a pattern, the most convenient way to do it is with (?!) because an empty string always matches, so an assertion that requires there not to be an empty string must always fail.

Lookbehind assertions start with (?<= for positive assertions and (?<! for negative assertions. For example,

  (?<!foo)bar

does find an occurrence of "bar" that is not preceded by "foo". The contents of a lookbehind assertion are restricted such that all the strings it matches must have a fixed length. However, if there are several alternatives, they do not all have to have the same fixed length. Thus

  (?<=bullock|donkey)

is permitted, but

  (?<!dogs?|cats?)

causes an error at compile time. Branches that match different length strings are permitted only at the top level of a lookbehind assertion. This is an extension compared with Perl (at least for 5.8), which requires all branches to match the same length of string. An assertion such as

  (?<=ab(c|de))

is not permitted, because its single top-level branch can match two different lengths, but it is acceptable if rewritten to use two top-level branches:

  (?<=abc|abde)

The implementation of lookbehind assertions is, for each alternative, to temporarily move the current position back by the fixed width and then try to match. If there are insufficient characters before the current position, the match is deemed to fail.

PCRE does not allow the \C escape (which matches a single byte in UTF-8 mode) to appear in lookbehind assertions, because it makes it impossible to calculate the length of the lookbehind.

Atomic groups can be used in conjunction with lookbehind assertions to specify efficient matching at the end of the subject string. Consider a simple pattern such as

  abcd$

when applied to a long string that does not match. Because matching proceeds from left to right, PCRE will look for each "a" in the subject and then see if what follows matches the rest of the pattern. If the pattern is specified as

  ^.*abcd$

the initial .* matches the entire string at first, but when this fails (because there is no following "a"), it backtracks to match all but the last character, then all but the last two characters, and so on. Once again the search for "a" covers the entire string, from right to left, so we are no better off. However, if the pattern is written as

  ^(?>.*)(?<=abcd)

or, equivalently,

  ^.*+(?<=abcd)

there can be no backtracking for the .* item; it can match only the entire string. The subsequent lookbehind assertion does a single test on the last four characters. If it fails, the match fails immediately. For long strings, this approach makes a significant difference to the processing time.

Several assertions (of any sort) may occur in succession. For example,

  (?<=\d{3})(?<!999)foo

matches "foo" preceded by three digits that are not "999". Notice that each of the assertions is applied independently at the same point in the subject string. First there is a check that the previous three characters are all digits, and then there is a check that the same three characters are not "999". This pattern does not match "foo" preceded by six characters, the first of which are digits and the last three of which are not "999". For example, it doesn't match "123abcfoo". A pattern to do that is

  (?<=\d{3}...)(?<!999)foo

This time the first assertion looks at the preceding six characters, checking that the first three are digits, and then the second assertion checks that the preceding three characters are not "999".

Assertions can be nested in any combination. For example,

  (?<=(?<!foo)bar)baz

matches an occurrence of "baz" that is preceded by "bar" which in turn is not preceded by "foo", while

  (?<=\d{3}(?!999)...)foo

is another pattern which matches "foo" preceded by three digits and any three characters that are not "999".

Assertion subpatterns are not capturing subpatterns, and may not be repeated, because it makes no sense to assert the same thing several times. If any kind of assertion contains capturing subpatterns within it, these are counted for the purposes of numbering the capturing subpatterns in the whole pattern. However, substring capturing is carried out only for positive assertions, because it does not make sense for negative assertions.


CONDITIONAL SUBPATTERNS

It is possible to cause the matching process to obey a subpattern conditionally or to choose between two alternative subpatterns, depending on the result of an assertion, or whether a previous capturing subpattern matched or not. The two possible forms of conditional subpattern are

  (?(condition)yes-pattern)
  (?(condition)yes-pattern|no-pattern)

If the condition is satisfied, the yes-pattern is used; otherwise the no-pattern (if present) is used. If there are more than two alternatives in the subpattern, a compile-time error occurs.

There are three kinds of condition. If the text between the parentheses consists of a sequence of digits, the condition is satisfied if the capturing subpattern of that number has previously matched. The number must be greater than zero. Consider the following pattern, which contains non-significant white space to make it more readable (assume the PCRE_EXTENDED option) and to divide it into three parts for ease of discussion:

  ( \( )?    [^()]+    (?(1) \) )

The first part matches an optional opening parenthesis, and if that character is present, sets it as the first captured substring. The second part matches one or more characters that are not parentheses. The third part is a conditional subpattern that tests whether the first set of parentheses matched or not. If they did, that is, if subject started with an opening parenthesis, the condition is true, and so the yes-pattern is executed and a closing parenthesis is required. Otherwise, since no-pattern is not present, the subpattern matches nothing. In other words, this pattern matches a sequence of non-parentheses, optionally enclosed in parentheses.

If the condition is the string (R), it is satisfied if a recursive call to the pattern or subpattern has been made. At "top level", the condition is false. This is a PCRE extension. Recursive patterns are described in the next section.

If the condition is not a sequence of digits or (R), it must be an assertion. This may be a positive or negative lookahead or lookbehind assertion. Consider this pattern, again containing non-significant white space, and with the two alternatives on the second line:

  (?(?=[^a-z]*[a-z])
  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} )

The condition is a positive lookahead assertion that matches an optional sequence of non-letters followed by a letter. In other words, it tests for the presence of at least one letter in the subject. If a letter is found, the subject is matched against the first alternative; otherwise it is matched against the second. This pattern matches strings in one of the two forms dd-aaa-dd or dd-dd-dd, where aaa are letters and dd are digits.


COMMENTS

The sequence (?# marks the start of a comment which continues up to the next closing parenthesis. Nested parentheses are not permitted. The characters that make up a comment play no part in the pattern matching at all.

If the PCRE_EXTENDED option is set, an unescaped # character outside a character class introduces a comment that continues up to the next newline character in the pattern.


RECURSIVE PATTERNS

Consider the problem of matching a string in parentheses, allowing for unlimited nested parentheses. Without the use of recursion, the best that can be done is to use a pattern that matches up to some fixed depth of nesting. It is not possible to handle an arbitrary nesting depth. Perl has provided an experimental facility that allows regular expressions to recurse (amongst other things). It does this by interpolating Perl code in the expression at run time, and the code can refer to the expression itself. A Perl pattern to solve the parentheses problem can be created like this:

  $re = qr{\( (?: (?>[^()]+) | (?p{$re}) )* \)}x;

The (?p{...}) item interpolates Perl code at run time, and in this case refers recursively to the pattern in which it appears. Obviously, PCRE cannot support the interpolation of Perl code. Instead, it supports some special syntax for recursion of the entire pattern, and also for individual subpattern recursion.

The special item that consists of (? followed by a number greater than zero and a closing parenthesis is a recursive call of the subpattern of the given number, provided that it occurs inside that subpattern. (If not, it is a "subroutine" call, which is described in the next section.) The special item (?R) is a recursive call of the entire regular expression.

For example, this PCRE pattern solves the nested parentheses problem (assume the PCRE_EXTENDED option is set so that white space is ignored):

  \( ( (?>[^()]+) | (?R) )* \)

First it matches an opening parenthesis. Then it matches any number of substrings which can either be a sequence of non-parentheses, or a recursive match of the pattern itself (that is a correctly parenthesized substring). Finally there is a closing parenthesis.

If this were part of a larger pattern, you would not want to recurse the entire pattern, so instead you could use this:

  ( \( ( (?>[^()]+) | (?1) )* \) )

We have put the pattern into parentheses, and caused the recursion to refer to them instead of the whole pattern. In a larger pattern, keeping track of parenthesis numbers can be tricky. It may be more convenient to use named parentheses instead. For this, PCRE uses (?P>name), which is an extension to the Python syntax that PCRE uses for named parentheses (Perl does not provide named parentheses). We could rewrite the above example as follows:

  (?P<pn> \( ( (?>[^()]+) | (?P>pn) )* \) )

This particular example pattern contains nested unlimited repeats, and so the use of atomic grouping for matching strings of non-parentheses is important when applying the pattern to strings that do not match. For example, when this pattern is applied to

  (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()

it yields "no match" quickly. However, if atomic grouping is not used, the match runs for a very long time indeed because there are so many different ways the + and * repeats can carve up the subject, and all have to be tested before failure can be reported.

At the end of a match, the values set for any capturing subpatterns are those from the outermost level of the recursion at which the subpattern value is set. If you want to obtain intermediate values, a callout function can be used (see below and the pcrecallout documentation). If the pattern above is matched against

  (ab(cd)ef)

the value for the capturing parentheses is "ef", which is the last value taken on at the top level. If additional parentheses are added, giving

  \( ( ( (?>[^()]+) | (?R) )* ) \)
     ^                        ^
     ^                        ^

the string they capture is "ab(cd)ef", the contents of the top level parentheses. If there are more than 15 capturing parentheses in a pattern, PCRE has to obtain extra memory to store data during a recursion, which it does by using pcre_malloc, freeing it via pcre_free afterwards. If no memory can be obtained, the match fails with the PCRE_ERROR_NOMEMORY error.

Do not confuse the (?R) item with the condition (R), which tests for recursion. Consider this pattern, which matches text in angle brackets, allowing for arbitrary nesting. Only digits are allowed in nested brackets (that is, when recursing), whereas any characters are permitted at the outer level.

  < (?: (?(R) \d++  | [^<>]*+) | (?R)) * >

In this pattern, (?(R) is the start of a conditional subpattern, with two different alternatives for the recursive and non-recursive cases. The (?R) item is the actual recursive call.


SUBPATTERNS AS SUBROUTINES

If the syntax for a recursive subpattern reference (either by number or by name) is used outside the parentheses to which it refers, it operates like a subroutine in a programming language. An earlier example pointed out that the pattern

  (sens|respons)e and \1ibility

matches "sense and sensibility" and "response and responsibility", but not "sense and responsibility". If instead the pattern

  (sens|respons)e and (?1)ibility

is used, it does match "sense and responsibility" as well as the other two strings. Such references must, however, follow the subpattern to which they refer.


CALLOUTS

Perl has a feature whereby using the sequence (?{...}) causes arbitrary Perl code to be obeyed in the middle of matching a regular expression. This makes it possible, amongst other things, to extract different substrings that match the same pair of parentheses when there is a repetition.

PCRE provides a similar feature, but of course it cannot obey arbitrary Perl code. The feature is called "callout". The caller of PCRE provides an external function by putting its entry point in the global variable pcre_callout. By default, this variable contains NULL, which disables all calling out.

Within a regular expression, (?C) indicates the points at which the external function is to be called. If you want to identify different callout points, you can put a number less than 256 after the letter C. The default value is zero. For example, this pattern has two callout points:

  (?C1)\dabc(?C2)def

During matching, when PCRE reaches a callout point (and pcre_callout is set), the external function is called. It is provided with the number of the callout, and, optionally, one item of data originally supplied by the caller of pcre_exec(). The callout function may cause matching to backtrack, or to fail altogether. A complete description of the interface to the callout function is given in the pcrecallout documentation.

Last updated: 03 February 2003
Copyright © 1997-2003 University of Cambridge. 0707010003ebe9000081a40000000a0000000a00000001402cbd6500000d830000008800000005000000000000000000000029ff350897reloc/doc/pcre/doc/html/pcreperform.html pcreperform specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.


PCRE PERFORMANCE

Certain items that may appear in regular expression patterns are more efficient than others. It is more efficient to use a character class like [aeiou] than a set of alternatives such as (a|e|i|o|u). In general, the simplest construction that provides the required behaviour is usually the most efficient. Jeffrey Friedl's book contains a lot of discussion about optimizing regular expressions for efficient performance.

When a pattern begins with .* not in parentheses, or in parentheses that are not the subject of a backreference, and the PCRE_DOTALL option is set, the pattern is implicitly anchored by PCRE, since it can match only at the start of a subject string. However, if PCRE_DOTALL is not set, PCRE cannot make this optimization, because the . metacharacter does not then match a newline, and if the subject string contains newlines, the pattern may match from the character immediately following one of them instead of from the very start. For example, the pattern

  .*second

matches the subject "first\nand second" (where \n stands for a newline character), with the match starting at the seventh character. In order to do this, PCRE has to retry the match starting after every newline in the subject.

If you are using such a pattern with subject strings that do not contain newlines, the best performance is obtained by setting PCRE_DOTALL, or starting the pattern with ^.* to indicate explicit anchoring. That saves PCRE from having to scan along the subject looking for a newline to restart at.

Beware of patterns that contain nested indefinite repeats. These can take a long time to run when applied to a string that does not match. Consider the pattern fragment

  (a+)*

This can match "aaaa" in 33 different ways, and this number increases very rapidly as the string gets longer. (The * repeat can match 0, 1, 2, 3, or 4 times, and for each of those cases other than 0, the + repeats can match different numbers of times.) When the remainder of the pattern is such that the entire match is going to fail, PCRE has in principle to try every possible variation, and this can take an extremely long time.

An optimization catches some of the more simple cases such as

  (a+)*b

where a literal character follows. Before embarking on the standard matching procedure, PCRE checks that there is a "b" later in the subject string, and if there is not, it fails the match immediately. However, when there is no following literal this optimization cannot be used. You can see the difference by comparing the behaviour of

  (a+)*\d

with the pattern above. The former gives a failure almost instantly when applied to a whole line of "a" characters, whereas the latter takes an appreciable time with strings longer than about 20 characters.

Last updated: 03 February 2003
Copyright © 1997-2003 University of Cambridge. 0707010003ebea000081a40000000a0000000a00000001402cbd65000022f10000008800000005000000000000000000000027ff350897reloc/doc/pcre/doc/html/pcreposix.html pcreposix specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.


SYNOPSIS OF POSIX API

#include <pcreposix.h>

int regcomp(regex_t *preg, const char *pattern, int cflags);

int regexec(regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags);

size_t regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size);

void regfree(regex_t *preg);


DESCRIPTION

This set of functions provides a POSIX-style API to the PCRE regular expression package. See the pcreapi documentation for a description of the native API, which contains additional functionality.

The functions described here are just wrapper functions that ultimately call the PCRE native API. Their prototypes are defined in the pcreposix.h header file, and on Unix systems the library itself is called pcreposix.a, so can be accessed by adding -lpcreposix to the command for linking an application which uses them. Because the POSIX functions call the native ones, it is also necessary to add \fR-lpcre\fR.

I have implemented only those option bits that can be reasonably mapped to PCRE native options. In addition, the options REG_EXTENDED and REG_NOSUB are defined with the value zero. They have no effect, but since programs that are written to the POSIX interface often use them, this makes it easier to slot in PCRE as a replacement library. Other POSIX options are not even defined.

When PCRE is called via these functions, it is only the API that is POSIX-like in style. The syntax and semantics of the regular expressions themselves are still those of Perl, subject to the setting of various PCRE options, as described below. "POSIX-like in style" means that the API approximates to the POSIX definition; it is not fully POSIX-compatible, and in multi-byte encoding domains it is probably even less compatible.

The header for these functions is supplied as pcreposix.h to avoid any potential clash with other POSIX libraries. It can, of course, be renamed or aliased as regex.h, which is the "correct" name. It provides two structure types, regex_t for compiled internal forms, and regmatch_t for returning captured substrings. It also defines some constants whose names start with "REG_"; these are used for setting options and identifying error codes.


COMPILING A PATTERN

The function regcomp() is called to compile a pattern into an internal form. The pattern is a C string terminated by a binary zero, and is passed in the argument pattern. The preg argument is a pointer to a regex_t structure which is used as a base for storing information about the compiled expression.

The argument cflags is either zero, or contains one or more of the bits defined by the following macros:

  REG_ICASE

The PCRE_CASELESS option is set when the expression is passed for compilation to the native function.

  REG_NEWLINE

The PCRE_MULTILINE option is set when the expression is passed for compilation to the native function. Note that this does not mimic the defined POSIX behaviour for REG_NEWLINE (see the following section).

In the absence of these flags, no options are passed to the native function. This means the the regex is compiled with PCRE default semantics. In particular, the way it handles newline characters in the subject string is the Perl way, not the POSIX way. Note that setting PCRE_MULTILINE has only some of the effects specified for REG_NEWLINE. It does not affect the way newlines are matched by . (they aren't) or by a negative class such as [^a] (they are).

The yield of regcomp() is zero on success, and non-zero otherwise. The preg structure is filled in on success, and one member of the structure is public: re_nsub contains the number of capturing subpatterns in the regular expression. Various error codes are defined in the header file.


MATCHING NEWLINE CHARACTERS

This area is not simple, because POSIX and Perl take different views of things. It is not possible to get PCRE to obey POSIX semantics, but then PCRE was never intended to be a POSIX engine. The following table lists the different possibilities for matching newline characters in PCRE:

                          Default   Change with

  . matches newline          no     PCRE_DOTALL
  newline matches [^a]       yes    not changeable
  $ matches \n at end        yes    PCRE_DOLLARENDONLY
  $ matches \n in middle     no     PCRE_MULTILINE
  ^ matches \n in middle     no     PCRE_MULTILINE

This is the equivalent table for POSIX:

                          Default   Change with

  . matches newline          yes      REG_NEWLINE
  newline matches [^a]       yes      REG_NEWLINE
  $ matches \n at end        no       REG_NEWLINE
  $ matches \n in middle     no       REG_NEWLINE
  ^ matches \n in middle     no       REG_NEWLINE

PCRE's behaviour is the same as Perl's, except that there is no equivalent for PCRE_DOLLARENDONLY in Perl. In both PCRE and Perl, there is no way to stop newline from matching [^a].

The default POSIX newline handling can be obtained by setting PCRE_DOTALL and PCRE_DOLLARENDONLY, but there is no way to make PCRE behave exactly as for the REG_NEWLINE action.


MATCHING A PATTERN

The function regexec() is called to match a pre-compiled pattern preg against a given string, which is terminated by a zero byte, subject to the options in eflags. These can be:

  REG_NOTBOL

The PCRE_NOTBOL option is set when calling the underlying PCRE matching function.

  REG_NOTEOL

The PCRE_NOTEOL option is set when calling the underlying PCRE matching function.

The portion of the string that was matched, and also any captured substrings, are returned via the pmatch argument, which points to an array of nmatch structures of type regmatch_t, containing the members rm_so and rm_eo. These contain the offset to the first character of each substring and the offset to the first character after the end of each substring, respectively. The 0th element of the vector relates to the entire portion of string that was matched; subsequent elements relate to the capturing subpatterns of the regular expression. Unused entries in the array have both structure members set to -1.

A successful match yields a zero return; various error codes are defined in the header file, of which REG_NOMATCH is the "expected" failure code.


ERROR MESSAGES

The regerror() function maps a non-zero errorcode from either regcomp() or regexec() to a printable message. If preg is not NULL, the error should have arisen from the use of that structure. A message terminated by a binary zero is placed in errbuf. The length of the message, including the zero, is limited to errbuf_size. The yield of the function is the size of buffer needed to hold the whole message.


STORAGE

Compiling a regular expression causes memory to be allocated and associated with the preg structure. The function regfree() frees all such memory, after which preg may no longer be used as a compiled expression.


AUTHOR

Philip Hazel <ph10@cam.ac.uk>
University Computing Service,
Cambridge CB2 3QG, England.

Last updated: 03 February 2003
Copyright © 1997-2003 University of Cambridge. 0707010003ebeb000081a40000000a0000000a00000001402cbd65000009860000008800000005000000000000000000000028ff350897reloc/doc/pcre/doc/html/pcresample.html pcresample specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.


PCRE SAMPLE PROGRAM

A simple, complete demonstration program, to get you started with using PCRE, is supplied in the file pcredemo.c in the PCRE distribution.

The program compiles the regular expression that is its first argument, and matches it against the subject string in its second argument. No PCRE options are set, and default character tables are used. If matching succeeds, the program outputs the portion of the subject that matched, together with the contents of any captured substrings.

If the -g option is given on the command line, the program then goes on to check for further matches of the same regular expression in the same subject string. The logic is a little bit tricky because of the possibility of matching an empty string. Comments in the code explain what is going on.

On a Unix system that has PCRE installed in /usr/local, you can compile the demonstration program using a command like this:

  gcc -o pcredemo pcredemo.c -I/usr/local/include \
      -L/usr/local/lib -lpcre

Then you can run simple tests like this:

  ./pcredemo 'cat|dog' 'the cat sat on the mat'
  ./pcredemo -g 'cat|dog' 'the dog sat on the cat'

Note that there is a much more comprehensive test program, called pcretest, which supports many more facilities for testing regular expressions and the PCRE library. The pcredemo program is provided as a simple coding example.

On some operating systems (e.g. Solaris) you may get an error like this when you try to run pcredemo:

  ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or directory

This is caused by the way shared library support works on those systems. You need to add

  -R/usr/local/lib

to the compile command to get round this problem.

Last updated: 28 January 2003
Copyright © 1997-2003 University of Cambridge. 0707010003ebec000081a40000000a0000000a00000001402cbd64000041660000008800000005000000000000000000000026ff350897reloc/doc/pcre/doc/html/pcretest.html pcretest specification This HTML document has been generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.


SYNOPSIS

pcretest [-d] [-i] [-m] [-o osize] [-p] [-t] [source] [destination]

pcretest was written as a test program for the PCRE regular expression library itself, but it can also be used for experimenting with regular expressions. This document describes the features of the test program; for details of the regular expressions themselves, see the pcrepattern documentation. For details of PCRE and its options, see the pcreapi documentation.


OPTIONS

-C Output the version number of the PCRE library, and all available information about the optional features that are included, and then exit.

-d Behave as if each regex had the /D modifier (see below); the internal form is output after compilation.

-i Behave as if each regex had the /I modifier; information about the compiled pattern is given after compilation.

-m Output the size of each compiled pattern after it has been compiled. This is equivalent to adding /M to each regular expression. For compatibility with earlier versions of pcretest, -s is a synonym for -m.

-o osize Set the number of elements in the output vector that is used when calling PCRE to be osize. The default value is 45, which is enough for 14 capturing subexpressions. The vector size can be changed for individual matching calls by including \O in the data line (see below).

-p Behave as if each regex has /P modifier; the POSIX wrapper API is used to call PCRE. None of the other options has any effect when -p is set.

-t Run each compile, study, and match many times with a timer, and output resulting time per compile or match (in milliseconds). Do not set -t with -m, because you will then get the size output 20000 times and the timing will be distorted.


DESCRIPTION

If pcretest is given two filename arguments, it reads from the first and writes to the second. If it is given only one filename argument, it reads from that file and writes to stdout. Otherwise, it reads from stdin and writes to stdout, and prompts for each line of input, using "re>" to prompt for regular expressions, and "data>" to prompt for data lines.

The program handles any number of sets of input on a single input file. Each set starts with a regular expression, and continues with any number of data lines to be matched against the pattern.

Each line is matched separately and independently. If you want to do multiple-line matches, you have to use the \n escape sequence in a single line of input to encode the newline characters. The maximum length of data line is 30,000 characters.

An empty line signals the end of the data lines, at which point a new regular expression is read. The regular expressions are given enclosed in any non-alphameric delimiters other than backslash, for example

  /(a|bc)x+yz/

White space before the initial delimiter is ignored. A regular expression may be continued over several input lines, in which case the newline characters are included within it. It is possible to include the delimiter within the pattern by escaping it, for example

  /abc\/def/

If you do so, the escape and the delimiter form part of the pattern, but since delimiters are always non-alphameric, this does not affect its interpretation. If the terminating delimiter is immediately followed by a backslash, for example,

  /abc/\

then a backslash is added to the end of the pattern. This is done to provide a way of testing the error condition that arises if a pattern finishes with a backslash, because

  /abc\/

is interpreted as the first line of a pattern that starts with "abc/", causing pcretest to read the next line as a continuation of the regular expression.


PATTERN MODIFIERS

The pattern may be followed by i, m, s, or x to set the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, or PCRE_EXTENDED options, respectively. For example:

  /caseless/i

These modifier letters have the same effect as they do in Perl. There are others that set PCRE options that do not correspond to anything in Perl: /A, /E, /N, /U, and /X set PCRE_ANCHORED, PCRE_DOLLAR_ENDONLY, PCRE_NO_AUTO_CAPTURE, PCRE_UNGREEDY, and PCRE_EXTRA respectively.

Searching for all possible matches within each subject string can be requested by the /g or /G modifier. After finding a match, PCRE is called again to search the remainder of the subject string. The difference between /g and /G is that the former uses the startoffset argument to pcre_exec() to start searching at a new point within the entire string (which is in effect what Perl does), whereas the latter passes over a shortened substring. This makes a difference to the matching process if the pattern begins with a lookbehind assertion (including \b or \B).

If any call to pcre_exec() in a /g or /G sequence matches an empty string, the next call is done with the PCRE_NOTEMPTY and PCRE_ANCHORED flags set in order to search for another, non-empty, match at the same point. If this second match fails, the start offset is advanced by one, and the normal match is retried. This imitates the way Perl handles such cases when using the /g modifier or the split() function.

There are a number of other modifiers for controlling the way pcretest operates.

The /+ modifier requests that as well as outputting the substring that matched the entire pattern, pcretest should in addition output the remainder of the subject string. This is useful for tests where the subject contains multiple copies of the same substring.

The /L modifier must be followed directly by the name of a locale, for example,

  /pattern/Lfr

For this reason, it must be the last modifier letter. The given locale is set, pcre_maketables() is called to build a set of character tables for the locale, and this is then passed to pcre_compile() when compiling the regular expression. Without an /L modifier, NULL is passed as the tables pointer; that is, /L applies only to the expression on which it appears.

The /I modifier requests that pcretest output information about the compiled expression (whether it is anchored, has a fixed first character, and so on). It does this by calling pcre_fullinfo() after compiling an expression, and outputting the information it gets back. If the pattern is studied, the results of that are also output.

The /D modifier is a PCRE debugging feature, which also assumes /I. It causes the internal form of compiled regular expressions to be output after compilation. If the pattern was studied, the information returned is also output.

The /S modifier causes pcre_study() to be called after the expression has been compiled, and the results used when the expression is matched.

The /M modifier causes the size of memory block used to hold the compiled pattern to be output.

The /P modifier causes pcretest to call PCRE via the POSIX wrapper API rather than its native API. When this is done, all other modifiers except /i, /m, and /+ are ignored. REG_ICASE is set if /i is present, and REG_NEWLINE is set if /m is present. The wrapper functions force PCRE_DOLLAR_ENDONLY always, and PCRE_DOTALL unless REG_NEWLINE is set.

The /8 modifier causes pcretest to call PCRE with the PCRE_UTF8 option set. This turns on support for UTF-8 character handling in PCRE, provided that it was compiled with this support enabled. This modifier also causes any non-printing characters in output strings to be printed using the \x{hh...} notation if they are valid UTF-8 sequences.

If the /? modifier is used with /8, it causes pcretest to call pcre_compile() with the PCRE_NO_UTF8_CHECK option, to suppress the checking of the string for UTF-8 validity.


CALLOUTS

If the pattern contains any callout requests, pcretest's callout function will be called. By default, it displays the callout number, and the start and current positions in the text at the callout time. For example, the output

  --->pqrabcdef
    0    ^  ^

indicates that callout number 0 occurred for a match attempt starting at the fourth character of the subject string, when the pointer was at the seventh character. The callout function returns zero (carry on matching) by default.

Inserting callouts may be helpful when using pcretest to check complicated regular expressions. For further information about callouts, see the pcrecallout documentation.

For testing the PCRE library, additional control of callout behaviour is available via escape sequences in the data, as described in the following section. In particular, it is possible to pass in a number as callout data (the default is zero). If the callout function receives a non-zero number, it returns that value instead of zero.


DATA LINES

Before each data line is passed to pcre_exec(), leading and trailing whitespace is removed, and it is then scanned for \ escapes. Some of these are pretty esoteric features, intended for checking out some of the more complicated features of PCRE. If you are just testing "ordinary" regular expressions, you probably don't need any of these. The following escapes are recognized:

  \a         alarm (= BEL)
  \b         backspace
  \e         escape
  \f         formfeed
  \n         newline
  \r         carriage return
  \t         tab
  \v         vertical tab
  \nnn       octal character (up to 3 octal digits)
  \xhh       hexadecimal character (up to 2 hex digits)
  \x{hh...}  hexadecimal character, any number of digits
               in UTF-8 mode
  \A         pass the PCRE_ANCHORED option to pcre_exec()
  \B         pass the PCRE_NOTBOL option to pcre_exec()
  \Cdd       call pcre_copy_substring() for substring dd
               after a successful match (any decimal number
               less than 32)
  \Cname     call pcre_copy_named_substring() for substring
               "name" after a successful match (name termin-
               ated by next non alphanumeric character)
  \C+        show the current captured substrings at callout
               time
  \C-        do not supply a callout function
  \C!n       return 1 instead of 0 when callout number n is
               reached
  \C!n!m     return 1 instead of 0 when callout number n is
               reached for the nth time
  \C*n       pass the number n (may be negative) as callout
               data
  \Gdd       call pcre_get_substring() for substring dd
               after a successful match (any decimal number
               less than 32)
  \Gname     call pcre_get_named_substring() for substring
               "name" after a successful match (name termin-
               ated by next non-alphanumeric character)
  \L         call pcre_get_substringlist() after a
               successful match
  \M         discover the minimum MATCH_LIMIT setting
  \N         pass the PCRE_NOTEMPTY option to pcre_exec()
  \Odd       set the size of the output vector passed to
               pcre_exec() to dd (any number of decimal
               digits)
  \S         output details of memory get/free calls during matching
  \Z         pass the PCRE_NOTEOL option to pcre_exec()
  \?         pass the PCRE_NO_UTF8_CHECK option to
               pcre_exec()

If \M is present, pcretest calls pcre_exec() several times, with different values in the match_limit field of the pcre_extra data structure, until it finds the minimum number that is needed for pcre_exec() to complete. This number is a measure of the amount of recursion and backtracking that takes place, and checking it out can be instructive. For most simple matches, the number is quite small, but for patterns with very large numbers of matching possibilities, it can become large very quickly with increasing length of subject string.

When \O is used, it may be higher or lower than the size set by the -O option (or defaulted to 45); \O applies only to the call of pcre_exec() for the line in which it appears.

A backslash followed by anything else just escapes the anything else. If the very last character is a backslash, it is ignored. This gives a way of passing an empty line as data, since a real empty line terminates the data input.

If /P was present on the regex, causing the POSIX wrapper API to be used, only \B, and \Z have any effect, causing REG_NOTBOL and REG_NOTEOL to be passed to regexec() respectively.

The use of \x{hh...} to represent UTF-8 characters is not dependent on the use of the /8 modifier on the pattern. It is recognized always. There may be any number of hexadecimal digits inside the braces. The result is from one to six bytes, encoded according to the UTF-8 rules.


OUTPUT FROM PCRETEST

When a match succeeds, pcretest outputs the list of captured substrings that pcre_exec() returns, starting with number 0 for the string that matched the whole pattern. Here is an example of an interactive pcretest run.

  $ pcretest
  PCRE version 4.00 08-Jan-2003

    re> /^abc(\d+)/
  data> abc123
   0: abc123
   1: 123
  data> xyz
  No match

If the strings contain any non-printing characters, they are output as \0x escapes, or as \x{...} escapes if the /8 modifier was present on the pattern. If the pattern has the /+ modifier, then the output for substring 0 is followed by the the rest of the subject string, identified by "0+" like this:

    re> /cat/+
  data> cataract
   0: cat
   0+ aract

If the pattern has the /g or /G modifier, the results of successive matching attempts are output in sequence, like this:

    re> /\Bi(\w\w)/g
  data> Mississippi
   0: iss
   1: ss
   0: iss
   1: ss
   0: ipp
   1: pp

"No match" is output only if the first match attempt fails.

If any of the sequences \C, \G, or \L are present in a data line that is successfully matched, the substrings extracted by the convenience functions are output with C, G, or L after the string number instead of a colon. This is in addition to the normal full list. The string length (that is, the return from the extraction function) is given in parentheses after each string for \C and \G.

Note that while patterns can be continued over several lines (a plain ">" prompt is used for continuations), data lines may not. However newlines can be included in data by means of the \n escape.


AUTHOR

Philip Hazel <ph10@cam.ac.uk>
University Computing Service,
Cambridge CB2 3QG, England.

Last updated: 09 December 2003
Copyright © 1997-2003 University of Cambridge. 07070100014552000081a40000000a0000000a00000001402cbd6500001b0c000000880000000500000000000000000000001aff350892reloc/doc/pcre/doc/pcre.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH DESCRIPTION .rs .sp The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl, with just a few differences. The current implementation of PCRE (release 4.x) corresponds approximately with Perl 5.8, including support for UTF-8 encoded strings. However, this support has to be explicitly enabled; it is not the default. PCRE is written in C and released as a C library. However, a number of people have written wrappers and interfaces of various kinds. A C++ class is included in these contributions, which can be found in the \fIContrib\fR directory at the primary FTP site, which is: .\" HTML .\" ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre Details of exactly which Perl regular expression features are and are not supported by PCRE are given in separate documents. See the .\" HREF \fBpcrepattern\fR .\" and .\" HREF \fBpcrecompat\fR .\" pages. Some features of PCRE can be included, excluded, or changed when the library is built. The .\" HREF \fBpcre_config()\fR .\" function makes it possible for a client to discover which features are available. Documentation about building PCRE for various operating systems can be found in the \fBREADME\fR file in the source distribution. .SH USER DOCUMENTATION .rs .sp The user documentation for PCRE has been split up into a number of different sections. In the "man" format, each of these is a separate "man page". In the HTML format, each is a separate page, linked from the index page. In the plain text format, all the sections are concatenated, for ease of searching. The sections are as follows: pcre this document pcreapi details of PCRE's native API pcrebuild options for building PCRE pcrecallout details of the callout feature pcrecompat discussion of Perl compatibility pcregrep description of the \fBpcregrep\fR command pcrepattern syntax and semantics of supported regular expressions pcreperform discussion of performance issues pcreposix the POSIX-compatible API pcresample discussion of the sample program pcretest the \fBpcretest\fR testing command In addition, in the "man" and HTML formats, there is a short page for each library function, listing its arguments and results. .SH LIMITATIONS .rs .sp There are some size limitations in PCRE but it is hoped that they will never in practice be relevant. The maximum length of a compiled pattern is 65539 (sic) bytes if PCRE is compiled with the default internal linkage size of 2. If you want to process regular expressions that are truly enormous, you can compile PCRE with an internal linkage size of 3 or 4 (see the \fBREADME\fR file in the source distribution and the .\" HREF \fBpcrebuild\fR .\" documentation for details). If these cases the limit is substantially larger. However, the speed of execution will be slower. All values in repeating quantifiers must be less than 65536. The maximum number of capturing subpatterns is 65535. There is no limit to the number of non-capturing subpatterns, but the maximum depth of nesting of all kinds of parenthesized subpattern, including capturing subpatterns, assertions, and other types of subpattern, is 200. The maximum length of a subject string is the largest positive number that an integer variable can hold. However, PCRE uses recursion to handle subpatterns and indefinite repetition. This means that the available stack space may limit the size of a subject string that can be processed by certain patterns. .\" HTML .SH UTF-8 SUPPORT .rs .sp Starting at release 3.3, PCRE has had some support for character strings encoded in the UTF-8 format. For release 4.0 this has been greatly extended to cover most common requirements. In order process UTF-8 strings, you must build PCRE to include UTF-8 support in the code, and, in addition, you must call .\" HREF \fBpcre_compile()\fR .\" with the PCRE_UTF8 option flag. When you do this, both the pattern and any subject strings that are matched against it are treated as UTF-8 strings instead of just strings of bytes. If you compile PCRE with UTF-8 support, but do not use it at run time, the library will be a bit bigger, but the additional run time overhead is limited to testing the PCRE_UTF8 flag in several places, so should not be very large. The following comments apply when PCRE is running in UTF-8 mode: 1. When you set the PCRE_UTF8 flag, the strings passed as patterns and subjects are checked for validity on entry to the relevant functions. If an invalid UTF-8 string is passed, an error return is given. In some situations, you may already know that your strings are valid, and therefore want to skip these checks in order to improve performance. If you set the PCRE_NO_UTF8_CHECK flag at compile time or at run time, PCRE assumes that the pattern or subject it is given (respectively) contains only valid UTF-8 codes. In this case, it does not diagnose an invalid UTF-8 string. If you pass an invalid UTF-8 string to PCRE when PCRE_NO_UTF8_CHECK is set, the results are undefined. Your program may crash. 2. In a pattern, the escape sequence \\x{...}, where the contents of the braces is a string of hexadecimal digits, is interpreted as a UTF-8 character whose code number is the given hexadecimal number, for example: \\x{1234}. If a non-hexadecimal digit appears between the braces, the item is not recognized. This escape sequence can be used either as a literal, or within a character class. 3. The original hexadecimal escape sequence, \\xhh, matches a two-byte UTF-8 character if the value is greater than 127. 4. Repeat quantifiers apply to complete UTF-8 characters, not to individual bytes, for example: \\x{100}{3}. 5. The dot metacharacter matches one UTF-8 character instead of a single byte. 6. The escape sequence \\C can be used to match a single byte in UTF-8 mode, but its use can lead to some strange effects. 7. The character escapes \\b, \\B, \\d, \\D, \\s, \\S, \\w, and \\W correctly test characters of any code value, but the characters that PCRE recognizes as digits, spaces, or word characters remain the same set as before, all with values less than 256. 8. Case-insensitive matching applies only to characters whose values are less than 256. PCRE does not support the notion of "case" for higher-valued characters. 9. PCRE does not support the use of Unicode tables and properties or the Perl escapes \\p, \\P, and \\X. .SH AUTHOR .rs .sp Philip Hazel .br University Computing Service, .br Cambridge CB2 3QG, England. .br Phone: +44 1223 334714 .in 0 Last updated: 20 August 2003 .br Copyright (c) 1997-2003 University of Cambridge. 07070100014553000081a40000000a0000000a00000001402cbd65000250ba000000880000000500000000000000000000001cff350892reloc/doc/pcre/doc/pcre.txtThis file contains a concatenation of the PCRE man pages, converted to plain text format for ease of searching with a text editor, or for use on systems that do not have a man page processor. The small individual files that give synopses of each function in the library have not been included. There are separate text files for the pcregrep and pcretest commands. ----------------------------------------------------------------------------- PCRE(3) PCRE(3) NAME PCRE - Perl-compatible regular expressions DESCRIPTION The PCRE library is a set of functions that implement regular expres- sion pattern matching using the same syntax and semantics as Perl, with just a few differences. The current implementation of PCRE (release 4.x) corresponds approximately with Perl 5.8, including support for UTF-8 encoded strings. However, this support has to be explicitly enabled; it is not the default. PCRE is written in C and released as a C library. However, a number of people have written wrappers and interfaces of various kinds. A C++ class is included in these contributions, which can be found in the Contrib directory at the primary FTP site, which is: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre Details of exactly which Perl regular expression features are and are not supported by PCRE are given in separate documents. See the pcrepat- tern and pcrecompat pages. Some features of PCRE can be included, excluded, or changed when the library is built. The pcre_config() function makes it possible for a client to discover which features are available. Documentation about building PCRE for various operating systems can be found in the README file in the source distribution. USER DOCUMENTATION The user documentation for PCRE has been split up into a number of dif- ferent sections. In the "man" format, each of these is a separate "man page". In the HTML format, each is a separate page, linked from the index page. In the plain text format, all the sections are concate- nated, for ease of searching. The sections are as follows: pcre this document pcreapi details of PCRE's native API pcrebuild options for building PCRE pcrecallout details of the callout feature pcrecompat discussion of Perl compatibility pcregrep description of the pcregrep command pcrepattern syntax and semantics of supported regular expressions pcreperform discussion of performance issues pcreposix the POSIX-compatible API pcresample discussion of the sample program pcretest the pcretest testing command In addition, in the "man" and HTML formats, there is a short page for each library function, listing its arguments and results. LIMITATIONS There are some size limitations in PCRE but it is hoped that they will never in practice be relevant. The maximum length of a compiled pattern is 65539 (sic) bytes if PCRE is compiled with the default internal linkage size of 2. If you want to process regular expressions that are truly enormous, you can compile PCRE with an internal linkage size of 3 or 4 (see the README file in the source distribution and the pcrebuild documentation for details). If these cases the limit is substantially larger. However, the speed of execution will be slower. All values in repeating quantifiers must be less than 65536. The maxi- mum number of capturing subpatterns is 65535. There is no limit to the number of non-capturing subpatterns, but the maximum depth of nesting of all kinds of parenthesized subpattern, including capturing subpatterns, assertions, and other types of subpat- tern, is 200. The maximum length of a subject string is the largest positive number that an integer variable can hold. However, PCRE uses recursion to han- dle subpatterns and indefinite repetition. This means that the avail- able stack space may limit the size of a subject string that can be processed by certain patterns. UTF-8 SUPPORT Starting at release 3.3, PCRE has had some support for character strings encoded in the UTF-8 format. For release 4.0 this has been greatly extended to cover most common requirements. In order process UTF-8 strings, you must build PCRE to include UTF-8 support in the code, and, in addition, you must call pcre_compile() with the PCRE_UTF8 option flag. When you do this, both the pattern and any subject strings that are matched against it are treated as UTF-8 strings instead of just strings of bytes. If you compile PCRE with UTF-8 support, but do not use it at run time, the library will be a bit bigger, but the additional run time overhead is limited to testing the PCRE_UTF8 flag in several places, so should not be very large. The following comments apply when PCRE is running in UTF-8 mode: 1. When you set the PCRE_UTF8 flag, the strings passed as patterns and subjects are checked for validity on entry to the relevant functions. If an invalid UTF-8 string is passed, an error return is given. In some situations, you may already know that your strings are valid, and therefore want to skip these checks in order to improve performance. If you set the PCRE_NO_UTF8_CHECK flag at compile time or at run time, PCRE assumes that the pattern or subject it is given (respectively) contains only valid UTF-8 codes. In this case, it does not diagnose an invalid UTF-8 string. If you pass an invalid UTF-8 string to PCRE when PCRE_NO_UTF8_CHECK is set, the results are undefined. Your program may crash. 2. In a pattern, the escape sequence \x{...}, where the contents of the braces is a string of hexadecimal digits, is interpreted as a UTF-8 character whose code number is the given hexadecimal number, for exam- ple: \x{1234}. If a non-hexadecimal digit appears between the braces, the item is not recognized. This escape sequence can be used either as a literal, or within a character class. 3. The original hexadecimal escape sequence, \xhh, matches a two-byte UTF-8 character if the value is greater than 127. 4. Repeat quantifiers apply to complete UTF-8 characters, not to indi- vidual bytes, for example: \x{100}{3}. 5. The dot metacharacter matches one UTF-8 character instead of a single byte. 6. The escape sequence \C can be used to match a single byte in UTF-8 mode, but its use can lead to some strange effects. 7. The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly test characters of any code value, but the characters that PCRE recog- nizes as digits, spaces, or word characters remain the same set as before, all with values less than 256. 8. Case-insensitive matching applies only to characters whose values are less than 256. PCRE does not support the notion of "case" for higher-valued characters. 9. PCRE does not support the use of Unicode tables and properties or the Perl escapes \p, \P, and \X. AUTHOR Philip Hazel University Computing Service, Cambridge CB2 3QG, England. Phone: +44 1223 334714 Last updated: 20 August 2003 Copyright (c) 1997-2003 University of Cambridge. ----------------------------------------------------------------------------- PCRE(3) PCRE(3) NAME PCRE - Perl-compatible regular expressions PCRE BUILD-TIME OPTIONS This document describes the optional features of PCRE that can be selected when the library is compiled. They are all selected, or dese- lected, by providing options to the configure script which is run before the make command. The complete list of options for configure (which includes the standard ones such as the selection of the instal- lation directory) can be obtained by running ./configure --help The following sections describe certain options whose names begin with --enable or --disable. These settings specify changes to the defaults for the configure command. Because of the way that configure works, --enable and --disable always come in pairs, so the complementary option always exists as well, but as it specifies the default, it is not described. UTF-8 SUPPORT To build PCRE with support for UTF-8 character strings, add --enable-utf8 to the configure command. Of itself, this does not make PCRE treat strings as UTF-8. As well as compiling PCRE with this option, you also have have to set the PCRE_UTF8 option when you call the pcre_compile() function. CODE VALUE OF NEWLINE By default, PCRE treats character 10 (linefeed) as the newline charac- ter. This is the normal newline character on Unix-like systems. You can compile PCRE to use character 13 (carriage return) instead by adding --enable-newline-is-cr to the configure command. For completeness there is also a --enable- newline-is-lf option, which explicitly specifies linefeed as the new- line character. BUILDING SHARED AND STATIC LIBRARIES The PCRE building process uses libtool to build both shared and static Unix libraries by default. You can suppress one of these by adding one of --disable-shared --disable-static to the configure command, as required. POSIX MALLOC USAGE When PCRE is called through the POSIX interface (see the pcreposix documentation), additional working storage is required for holding the pointers to capturing substrings because PCRE requires three integers per substring, whereas the POSIX interface provides only two. If the number of expected substrings is small, the wrapper function uses space on the stack, because this is faster than using malloc() for each call. The default threshold above which the stack is no longer used is 10; it can be changed by adding a setting such as --with-posix-malloc-threshold=20 to the configure command. LIMITING PCRE RESOURCE USAGE Internally, PCRE has a function called match() which it calls repeat- edly (possibly recursively) when performing a matching operation. By limiting the number of times this function may be called, a limit can be placed on the resources used by a single call to pcre_exec(). The limit can be changed at run time, as described in the pcreapi documen- tation. The default is 10 million, but this can be changed by adding a setting such as --with-match-limit=500000 to the configure command. HANDLING VERY LARGE PATTERNS Within a compiled pattern, offset values are used to point from one part to another (for example, from an opening parenthesis to an alter- nation metacharacter). By default two-byte values are used for these offsets, leading to a maximum size for a compiled pattern of around 64K. This is sufficient to handle all but the most gigantic patterns. Nevertheless, some people do want to process enormous patterns, so it is possible to compile PCRE to use three-byte or four-byte offsets by adding a setting such as --with-link-size=3 to the configure command. The value given must be 2, 3, or 4. Using longer offsets slows down the operation of PCRE because it has to load additional bytes when handling them. If you build PCRE with an increased link size, test 2 (and test 5 if you are using UTF-8) will fail. Part of the output of these tests is a representation of the compiled pattern, and this changes with the link size. AVOIDING EXCESSIVE STACK USAGE PCRE implements backtracking while matching by making recursive calls to an internal function called match(). In environments where the size of the stack is limited, this can severely limit PCRE's operation. (The Unix environment does not usually suffer from this problem.) An alter- native approach that uses memory from the heap to remember data, instead of using recursive function calls, has been implemented to work round this problem. If you want to build a version of PCRE that works this way, add --disable-stack-for-recursion to the configure command. With this configuration, PCRE will use the pcre_stack_malloc and pcre_stack_free variables to call memory management functions. Separate functions are provided because the usage is very predictable: the block sizes requested are always the same, and the blocks are always freed in reverse order. A calling program might be able to implement optimized functions that perform better than the standard malloc() and free() functions. PCRE runs noticeably more slowly when built in this way. USING EBCDIC CODE PCRE assumes by default that it will run in an environment where the character code is ASCII (or UTF-8, which is a superset of ASCII). PCRE can, however, be compiled to run in an EBCDIC environment by adding --enable-ebcdic to the configure command. Last updated: 09 December 2003 Copyright (c) 1997-2003 University of Cambridge. ----------------------------------------------------------------------------- PCRE(3) PCRE(3) NAME PCRE - Perl-compatible regular expressions SYNOPSIS OF PCRE API #include pcre *pcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr); pcre_extra *pcre_study(const pcre *code, int options, const char **errptr); int pcre_exec(const pcre *code, const pcre_extra *extra, const char *subject, int length, int startoffset, int options, int *ovector, int ovecsize); int pcre_copy_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int buffersize); int pcre_copy_substring(const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int buffersize); int pcre_get_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, const char **stringptr); int pcre_get_stringnumber(const pcre *code, const char *name); int pcre_get_substring(const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr); int pcre_get_substring_list(const char *subject, int *ovector, int stringcount, const char ***listptr); void pcre_free_substring(const char *stringptr); void pcre_free_substring_list(const char **stringptr); const unsigned char *pcre_maketables(void); int pcre_fullinfo(const pcre *code, const pcre_extra *extra, int what, void *where); int pcre_info(const pcre *code, int *optptr, int *firstcharptr); int pcre_config(int what, void *where); char *pcre_version(void); void *(*pcre_malloc)(size_t); void (*pcre_free)(void *); void *(*pcre_stack_malloc)(size_t); void (*pcre_stack_free)(void *); int (*pcre_callout)(pcre_callout_block *); PCRE API PCRE has its own native API, which is described in this document. There is also a set of wrapper functions that correspond to the POSIX regular expression API. These are described in the pcreposix documentation. The native API function prototypes are defined in the header file pcre.h, and on Unix systems the library itself is called libpcre.a, so can be accessed by adding -lpcre to the command for linking an applica- tion which calls it. The header file defines the macros PCRE_MAJOR and PCRE_MINOR to contain the major and minor release numbers for the library. Applications can use these to include support for different releases. The functions pcre_compile(), pcre_study(), and pcre_exec() are used for compiling and matching regular expressions. A sample program that demonstrates the simplest way of using them is given in the file pcre- demo.c. The pcresample documentation describes how to run it. There are convenience functions for extracting captured substrings from a matched subject string. They are: pcre_copy_substring() pcre_copy_named_substring() pcre_get_substring() pcre_get_named_substring() pcre_get_substring_list() pcre_free_substring() and pcre_free_substring_list() are also provided, to free the memory used for extracted strings. The function pcre_maketables() is used (optionally) to build a set of character tables in the current locale for passing to pcre_compile(). The function pcre_fullinfo() is used to find out information about a compiled pattern; pcre_info() is an obsolete version which returns only some of the available information, but is retained for backwards com- patibility. The function pcre_version() returns a pointer to a string containing the version of PCRE and its date of release. The global variables pcre_malloc and pcre_free initially contain the entry points of the standard malloc() and free() functions respec- tively. PCRE calls the memory management functions via these variables, so a calling program can replace them if it wishes to intercept the calls. This should be done before calling any PCRE functions. The global variables pcre_stack_malloc and pcre_stack_free are also indirections to memory management functions. These special functions are used only when PCRE is compiled to use the heap for remembering data, instead of recursive function calls. This is a non-standard way of building PCRE, for use in environments that have limited stacks. Because of the greater use of memory management, it runs more slowly. Separate functions are provided so that special-purpose external code can be used for this case. When used, these functions are always called in a stack-like manner (last obtained, first freed), and always for memory blocks of the same size. The global variable pcre_callout initially contains NULL. It can be set by the caller to a "callout" function, which PCRE will then call at specified points during a matching operation. Details are given in the pcrecallout documentation. MULTITHREADING The PCRE functions can be used in multi-threading applications, with the proviso that the memory management functions pointed to by pcre_malloc, pcre_free, pcre_stack_malloc, and pcre_stack_free, and the callout function pointed to by pcre_callout, are shared by all threads. The compiled form of a regular expression is not altered during match- ing, so the same compiled pattern can safely be used by several threads at once. CHECKING BUILD-TIME OPTIONS int pcre_config(int what, void *where); The function pcre_config() makes it possible for a PCRE client to dis- cover which optional features have been compiled into the PCRE library. The pcrebuild documentation has more details about these optional fea- tures. The first argument for pcre_config() is an integer, specifying which information is required; the second argument is a pointer to a variable into which the information is placed. The following information is available: PCRE_CONFIG_UTF8 The output is an integer that is set to one if UTF-8 support is avail- able; otherwise it is set to zero. PCRE_CONFIG_NEWLINE The output is an integer that is set to the value of the code that is used for the newline character. It is either linefeed (10) or carriage return (13), and should normally be the standard character for your operating system. PCRE_CONFIG_LINK_SIZE The output is an integer that contains the number of bytes used for internal linkage in compiled regular expressions. The value is 2, 3, or 4. Larger values allow larger regular expressions to be compiled, at the expense of slower matching. The default value of 2 is sufficient for all but the most massive patterns, since it allows the compiled pattern to be up to 64K in size. PCRE_CONFIG_POSIX_MALLOC_THRESHOLD The output is an integer that contains the threshold above which the POSIX interface uses malloc() for output vectors. Further details are given in the pcreposix documentation. PCRE_CONFIG_MATCH_LIMIT The output is an integer that gives the default limit for the number of internal matching function calls in a pcre_exec() execution. Further details are given with pcre_exec() below. PCRE_CONFIG_STACKRECURSE The output is an integer that is set to one if internal recursion is implemented by recursive function calls that use the stack to remember their state. This is the usual way that PCRE is compiled. The output is zero if PCRE was compiled to use blocks of data on the heap instead of recursive function calls. In this case, pcre_stack_malloc and pcre_stack_free are called to manage memory blocks on the heap, thus avoiding the use of the stack. COMPILING A PATTERN pcre *pcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr); The function pcre_compile() is called to compile a pattern into an internal form. The pattern is a C string terminated by a binary zero, and is passed in the argument pattern. A pointer to a single block of memory that is obtained via pcre_malloc is returned. This contains the compiled code and related data. The pcre type is defined for the returned block; this is a typedef for a structure whose contents are not externally defined. It is up to the caller to free the memory when it is no longer required. Although the compiled code of a PCRE regex is relocatable, that is, it does not depend on memory location, the complete pcre data block is not fully relocatable, because it contains a copy of the tableptr argument, which is an address (see below). The options argument contains independent bits that affect the compila- tion. It should be zero if no options are required. Some of the options, in particular, those that are compatible with Perl, can also be set and unset from within the pattern (see the detailed description of regular expressions in the pcrepattern documentation). For these options, the contents of the options argument specifies their initial settings at the start of compilation and execution. The PCRE_ANCHORED option can be set at the time of matching as well as at compile time. If errptr is NULL, pcre_compile() returns NULL immediately. Otherwise, if compilation of a pattern fails, pcre_compile() returns NULL, and sets the variable pointed to by errptr to point to a textual error mes- sage. The offset from the start of the pattern to the character where the error was discovered is placed in the variable pointed to by erroffset, which must not be NULL. If it is, an immediate error is given. If the final argument, tableptr, is NULL, PCRE uses a default set of character tables which are built when it is compiled, using the default C locale. Otherwise, tableptr must be the result of a call to pcre_maketables(). See the section on locale support below. This code fragment shows a typical straightforward call to pcre_com- pile(): pcre *re; const char *error; int erroffset; re = pcre_compile( "^A.*Z", /* the pattern */ 0, /* default options */ &error, /* for error message */ &erroffset, /* for error offset */ NULL); /* use default character tables */ The following option bits are defined: PCRE_ANCHORED If this bit is set, the pattern is forced to be "anchored", that is, it is constrained to match only at the first matching point in the string which is being searched (the "subject string"). This effect can also be achieved by appropriate constructs in the pattern itself, which is the only way to do it in Perl. PCRE_CASELESS If this bit is set, letters in the pattern match both upper and lower case letters. It is equivalent to Perl's /i option, and it can be changed within a pattern by a (?i) option setting. PCRE_DOLLAR_ENDONLY If this bit is set, a dollar metacharacter in the pattern matches only at the end of the subject string. Without this option, a dollar also matches immediately before the final character if it is a newline (but not before any other newlines). The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is set. There is no equivalent to this option in Perl, and no way to set it within a pattern. PCRE_DOTALL If this bit is set, a dot metacharater in the pattern matches all char- acters, including newlines. Without it, newlines are excluded. This option is equivalent to Perl's /s option, and it can be changed within a pattern by a (?s) option setting. A negative class such as [^a] always matches a newline character, independent of the setting of this option. PCRE_EXTENDED If this bit is set, whitespace data characters in the pattern are totally ignored except when escaped or inside a character class. Whitespace does not include the VT character (code 11). In addition, characters between an unescaped # outside a character class and the next newline character, inclusive, are also ignored. This is equivalent to Perl's /x option, and it can be changed within a pattern by a (?x) option setting. This option makes it possible to include comments inside complicated patterns. Note, however, that this applies only to data characters. Whitespace characters may never appear within special character sequences in a pattern, for example within the sequence (?( which introduces a conditional subpattern. PCRE_EXTRA This option was invented in order to turn on additional functionality of PCRE that is incompatible with Perl, but it is currently of very little use. When set, any backslash in a pattern that is followed by a letter that has no special meaning causes an error, thus reserving these combinations for future expansion. By default, as in Perl, a backslash followed by a letter with no special meaning is treated as a literal. There are at present no other features controlled by this option. It can also be set by a (?X) option setting within a pattern. PCRE_MULTILINE By default, PCRE treats the subject string as consisting of a single "line" of characters (even if it actually contains several newlines). The "start of line" metacharacter (^) matches only at the start of the string, while the "end of line" metacharacter ($) matches only at the end of the string, or before a terminating newline (unless PCRE_DOL- LAR_ENDONLY is set). This is the same as Perl. When PCRE_MULTILINE it is set, the "start of line" and "end of line" constructs match immediately following or immediately before any new- line in the subject string, respectively, as well as at the very start and end. This is equivalent to Perl's /m option, and it can be changed within a pattern by a (?m) option setting. If there are no "\n" charac- ters in a subject string, or no occurrences of ^ or $ in a pattern, setting PCRE_MULTILINE has no effect. PCRE_NO_AUTO_CAPTURE If this option is set, it disables the use of numbered capturing paren- theses in the pattern. Any opening parenthesis that is not followed by ? behaves as if it were followed by ?: but named parentheses can still be used for capturing (and they acquire numbers in the usual way). There is no equivalent of this option in Perl. PCRE_UNGREEDY This option inverts the "greediness" of the quantifiers so that they are not greedy by default, but become greedy if followed by "?". It is not compatible with Perl. It can also be set by a (?U) option setting within the pattern. PCRE_UTF8 This option causes PCRE to regard both the pattern and the subject as strings of UTF-8 characters instead of single-byte character strings. However, it is available only if PCRE has been built to include UTF-8 support. If not, the use of this option provokes an error. Details of how this option changes the behaviour of PCRE are given in the section on UTF-8 support in the main pcre page. PCRE_NO_UTF8_CHECK When PCRE_UTF8 is set, the validity of the pattern as a UTF-8 string is automatically checked. If an invalid UTF-8 sequence of bytes is found, pcre_compile() returns an error. If you already know that your pattern is valid, and you want to skip this check for performance reasons, you can set the PCRE_NO_UTF8_CHECK option. When it is set, the effect of passing an invalid UTF-8 string as a pattern is undefined. It may cause your program to crash. Note that there is a similar option for sup- pressing the checking of subject strings passed to pcre_exec(). STUDYING A PATTERN pcre_extra *pcre_study(const pcre *code, int options, const char **errptr); When a pattern is going to be used several times, it is worth spending more time analyzing it in order to speed up the time taken for match- ing. The function pcre_study() takes a pointer to a compiled pattern as its first argument. If studing the pattern produces additional informa- tion that will help speed up matching, pcre_study() returns a pointer to a pcre_extra block, in which the study_data field points to the results of the study. The returned value from a pcre_study() can be passed directly to pcre_exec(). However, the pcre_extra block also contains other fields that can be set by the caller before the block is passed; these are described below. If studying the pattern does not produce any addi- tional information, pcre_study() returns NULL. In that circumstance, if the calling program wants to pass some of the other fields to pcre_exec(), it must set up its own pcre_extra block. The second argument contains option bits. At present, no options are defined for pcre_study(), and this argument should always be zero. The third argument for pcre_study() is a pointer for an error message. If studying succeeds (even if no data is returned), the variable it points to is set to NULL. Otherwise it points to a textual error mes- sage. You should therefore test the error pointer for NULL after call- ing pcre_study(), to be sure that it has run successfully. This is a typical call to pcre_study(): pcre_extra *pe; pe = pcre_study( re, /* result of pcre_compile() */ 0, /* no options exist */ &error); /* set to NULL or points to a message */ At present, studying a pattern is useful only for non-anchored patterns that do not have a single fixed starting character. A bitmap of possi- ble starting characters is created. LOCALE SUPPORT PCRE handles caseless matching, and determines whether characters are letters, digits, or whatever, by reference to a set of tables. When running in UTF-8 mode, this applies only to characters with codes less than 256. The library contains a default set of tables that is created in the default C locale when PCRE is compiled. This is used when the final argument of pcre_compile() is NULL, and is sufficient for many applications. An alternative set of tables can, however, be supplied. Such tables are built by calling the pcre_maketables() function, which has no argu- ments, in the relevant locale. The result can then be passed to pcre_compile() as often as necessary. For example, to build and use tables that are appropriate for the French locale (where accented char- acters with codes greater than 128 are treated as letters), the follow- ing code could be used: setlocale(LC_CTYPE, "fr"); tables = pcre_maketables(); re = pcre_compile(..., tables); The tables are built in memory that is obtained via pcre_malloc. The pointer that is passed to pcre_compile is saved with the compiled pat- tern, and the same tables are used via this pointer by pcre_study() and pcre_exec(). Thus, for any single pattern, compilation, studying and matching all happen in the same locale, but different patterns can be compiled in different locales. It is the caller's responsibility to ensure that the memory containing the tables remains available for as long as it is needed. INFORMATION ABOUT A PATTERN int pcre_fullinfo(const pcre *code, const pcre_extra *extra, int what, void *where); The pcre_fullinfo() function returns information about a compiled pat- tern. It replaces the obsolete pcre_info() function, which is neverthe- less retained for backwards compability (and is documented below). The first argument for pcre_fullinfo() is a pointer to the compiled pattern. The second argument is the result of pcre_study(), or NULL if the pattern was not studied. The third argument specifies which piece of information is required, and the fourth argument is a pointer to a variable to receive the data. The yield of the function is zero for success, or one of the following negative numbers: PCRE_ERROR_NULL the argument code was NULL the argument where was NULL PCRE_ERROR_BADMAGIC the "magic number" was not found PCRE_ERROR_BADOPTION the value of what was invalid Here is a typical call of pcre_fullinfo(), to obtain the length of the compiled pattern: int rc; unsigned long int length; rc = pcre_fullinfo( re, /* result of pcre_compile() */ pe, /* result of pcre_study(), or NULL */ PCRE_INFO_SIZE, /* what is required */ &length); /* where to put the data */ The possible values for the third argument are defined in pcre.h, and are as follows: PCRE_INFO_BACKREFMAX Return the number of the highest back reference in the pattern. The fourth argument should point to an int variable. Zero is returned if there are no back references. PCRE_INFO_CAPTURECOUNT Return the number of capturing subpatterns in the pattern. The fourth argument should point to an int variable. PCRE_INFO_FIRSTBYTE Return information about the first byte of any matched string, for a non-anchored pattern. (This option used to be called PCRE_INFO_FIRSTCHAR; the old name is still recognized for backwards compatibility.) If there is a fixed first byte, e.g. from a pattern such as (cat|cow|coyote), it is returned in the integer pointed to by where. Otherwise, if either (a) the pattern was compiled with the PCRE_MULTILINE option, and every branch starts with "^", or (b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set (if it were set, the pattern would be anchored), -1 is returned, indicating that the pattern matches only at the start of a subject string or after any newline within the string. Otherwise -2 is returned. For anchored patterns, -2 is returned. PCRE_INFO_FIRSTTABLE If the pattern was studied, and this resulted in the construction of a 256-bit table indicating a fixed set of bytes for the first byte in any matching string, a pointer to the table is returned. Otherwise NULL is returned. The fourth argument should point to an unsigned char * vari- able. PCRE_INFO_LASTLITERAL Return the value of the rightmost literal byte that must exist in any matched string, other than at its start, if such a byte has been recorded. The fourth argument should point to an int variable. If there is no such byte, -1 is returned. For anchored patterns, a last literal byte is recorded only if it follows something of variable length. For example, for the pattern /^a\d+z\d+/ the returned value is "z", but for /^a\dz\d/ the returned value is -1. PCRE_INFO_NAMECOUNT PCRE_INFO_NAMEENTRYSIZE PCRE_INFO_NAMETABLE PCRE supports the use of named as well as numbered capturing parenthe- ses. The names are just an additional way of identifying the parenthe- ses, which still acquire a number. A caller that wants to extract data from a named subpattern must convert the name to a number in order to access the correct pointers in the output vector (described with pcre_exec() below). In order to do this, it must first use these three values to obtain the name-to-number mapping table for the pattern. The map consists of a number of fixed-size entries. PCRE_INFO_NAMECOUNT gives the number of entries, and PCRE_INFO_NAMEENTRYSIZE gives the size of each entry; both of these return an int value. The entry size depends on the length of the longest name. PCRE_INFO_NAMETABLE returns a pointer to the first entry of the table (a pointer to char). The first two bytes of each entry are the number of the capturing parenthe- sis, most significant byte first. The rest of the entry is the corre- sponding name, zero terminated. The names are in alphabetical order. For example, consider the following pattern (assume PCRE_EXTENDED is set, so white space - including newlines - is ignored): (?P (?P(\d\d)?\d\d) - (?P\d\d) - (?P\d\d) ) There are four named subpatterns, so the table has four entries, and each entry in the table is eight bytes long. The table is as follows, with non-printing bytes shows in hex, and undefined bytes shown as ??: 00 01 d a t e 00 ?? 00 05 d a y 00 ?? ?? 00 04 m o n t h 00 00 02 y e a r 00 ?? When writing code to extract data from named subpatterns, remember that the length of each entry may be different for each compiled pattern. PCRE_INFO_OPTIONS Return a copy of the options with which the pattern was compiled. The fourth argument should point to an unsigned long int variable. These option bits are those specified in the call to pcre_compile(), modified by any top-level option settings within the pattern itself. A pattern is automatically anchored by PCRE if all of its top-level alternatives begin with one of the following: ^ unless PCRE_MULTILINE is set \A always \G always .* if PCRE_DOTALL is set and there are no back references to the subpattern in which .* appears For such patterns, the PCRE_ANCHORED bit is set in the options returned by pcre_fullinfo(). PCRE_INFO_SIZE Return the size of the compiled pattern, that is, the value that was passed as the argument to pcre_malloc() when PCRE was getting memory in which to place the compiled data. The fourth argument should point to a size_t variable. PCRE_INFO_STUDYSIZE Returns the size of the data block pointed to by the study_data field in a pcre_extra block. That is, it is the value that was passed to pcre_malloc() when PCRE was getting memory into which to place the data created by pcre_study(). The fourth argument should point to a size_t variable. OBSOLETE INFO FUNCTION int pcre_info(const pcre *code, int *optptr, int *firstcharptr); The pcre_info() function is now obsolete because its interface is too restrictive to return all the available data about a compiled pattern. New programs should use pcre_fullinfo() instead. The yield of pcre_info() is the number of capturing subpatterns, or one of the fol- lowing negative numbers: PCRE_ERROR_NULL the argument code was NULL PCRE_ERROR_BADMAGIC the "magic number" was not found If the optptr argument is not NULL, a copy of the options with which the pattern was compiled is placed in the integer it points to (see PCRE_INFO_OPTIONS above). If the pattern is not anchored and the firstcharptr argument is not NULL, it is used to pass back information about the first character of any matched string (see PCRE_INFO_FIRSTBYTE above). MATCHING A PATTERN int pcre_exec(const pcre *code, const pcre_extra *extra, const char *subject, int length, int startoffset, int options, int *ovector, int ovecsize); The function pcre_exec() is called to match a subject string against a pre-compiled pattern, which is passed in the code argument. If the pat- tern has been studied, the result of the study should be passed in the extra argument. Here is an example of a simple call to pcre_exec(): int rc; int ovector[30]; rc = pcre_exec( re, /* result of pcre_compile() */ NULL, /* we didn't study the pattern */ "some string", /* the subject string */ 11, /* the length of the subject string */ 0, /* start at offset 0 in the subject */ 0, /* default options */ ovector, /* vector for substring information */ 30); /* number of elements in the vector */ If the extra argument is not NULL, it must point to a pcre_extra data block. The pcre_study() function returns such a block (when it doesn't return NULL), but you can also create one for yourself, and pass addi- tional information in it. The fields in the block are as follows: unsigned long int flags; void *study_data; unsigned long int match_limit; void *callout_data; The flags field is a bitmap that specifies which of the other fields are set. The flag bits are: PCRE_EXTRA_STUDY_DATA PCRE_EXTRA_MATCH_LIMIT PCRE_EXTRA_CALLOUT_DATA Other flag bits should be set to zero. The study_data field is set in the pcre_extra block that is returned by pcre_study(), together with the appropriate flag bit. You should not set this yourself, but you can add to the block by setting the other fields. The match_limit field provides a means of preventing PCRE from using up a vast amount of resources when running patterns that are not going to match, but which have a very large number of possibilities in their search trees. The classic example is the use of nested unlimited repeats. Internally, PCRE uses a function called match() which it calls repeatedly (sometimes recursively). The limit is imposed on the number of times this function is called during a match, which has the effect of limiting the amount of recursion and backtracking that can take place. For patterns that are not anchored, the count starts from zero for each position in the subject string. The default limit for the library can be set when PCRE is built; the default default is 10 million, which handles all but the most extreme cases. You can reduce the default by suppling pcre_exec() with a pcre_extra block in which match_limit is set to a smaller value, and PCRE_EXTRA_MATCH_LIMIT is set in the flags field. If the limit is exceeded, pcre_exec() returns PCRE_ERROR_MATCHLIMIT. The pcre_callout field is used in conjunction with the "callout" fea- ture, which is described in the pcrecallout documentation. The PCRE_ANCHORED option can be passed in the options argument, whose unused bits must be zero. This limits pcre_exec() to matching at the first matching position. However, if a pattern was compiled with PCRE_ANCHORED, or turned out to be anchored by virtue of its contents, it cannot be made unachored at matching time. When PCRE_UTF8 was set at compile time, the validity of the subject as a UTF-8 string is automatically checked, and the value of startoffset is also checked to ensure that it points to the start of a UTF-8 char- acter. If an invalid UTF-8 sequence of bytes is found, pcre_exec() returns the error PCRE_ERROR_BADUTF8. If startoffset contains an invalid value, PCRE_ERROR_BADUTF8_OFFSET is returned. If you already know that your subject is valid, and you want to skip these checks for performance reasons, you can set the PCRE_NO_UTF8_CHECK option when calling pcre_exec(). You might want to do this for the second and subsequent calls to pcre_exec() if you are making repeated calls to find all the matches in a single subject string. However, you should be sure that the value of startoffset points to the start of a UTF-8 character. When PCRE_NO_UTF8_CHECK is set, the effect of passing an invalid UTF-8 string as a subject, or a value of startoffset that does not point to the start of a UTF-8 char- acter, is undefined. Your program may crash. There are also three further options that can be set only at matching time: PCRE_NOTBOL The first character of the string is not the beginning of a line, so the circumflex metacharacter should not match before it. Setting this without PCRE_MULTILINE (at compile time) causes circumflex never to match. PCRE_NOTEOL The end of the string is not the end of a line, so the dollar metachar- acter should not match it nor (except in multiline mode) a newline immediately before it. Setting this without PCRE_MULTILINE (at compile time) causes dollar never to match. PCRE_NOTEMPTY An empty string is not considered to be a valid match if this option is set. If there are alternatives in the pattern, they are tried. If all the alternatives match the empty string, the entire match fails. For example, if the pattern a?b? is applied to a string not beginning with "a" or "b", it matches the empty string at the start of the subject. With PCRE_NOTEMPTY set, this match is not valid, so PCRE searches further into the string for occur- rences of "a" or "b". Perl has no direct equivalent of PCRE_NOTEMPTY, but it does make a spe- cial case of a pattern match of the empty string within its split() function, and when using the /g modifier. It is possible to emulate Perl's behaviour after matching a null string by first trying the match again at the same offset with PCRE_NOTEMPTY set, and then if that fails by advancing the starting offset (see below) and trying an ordinary match again. The subject string is passed to pcre_exec() as a pointer in subject, a length in length, and a starting byte offset in startoffset. Unlike the pattern string, the subject may contain binary zero bytes. When the starting offset is zero, the search for a match starts at the beginning of the subject, and this is by far the most common case. If the pattern was compiled with the PCRE_UTF8 option, the subject must be a sequence of bytes that is a valid UTF-8 string, and the starting offset must point to the beginning of a UTF-8 character. If an invalid UTF-8 string or offset is passed, an error (either PCRE_ERROR_BADUTF8 or PCRE_ERROR_BADUTF8_OFFSET) is returned, unless the option PCRE_NO_UTF8_CHECK is set, in which case PCRE's behaviour is not defined. A non-zero starting offset is useful when searching for another match in the same subject by calling pcre_exec() again after a previous suc- cess. Setting startoffset differs from just passing over a shortened string and setting PCRE_NOTBOL in the case of a pattern that begins with any kind of lookbehind. For example, consider the pattern \Biss\B which finds occurrences of "iss" in the middle of words. (\B matches only if the current position in the subject is not a word boundary.) When applied to the string "Mississipi" the first call to pcre_exec() finds the first occurrence. If pcre_exec() is called again with just the remainder of the subject, namely "issipi", it does not match, because \B is always false at the start of the subject, which is deemed to be a word boundary. However, if pcre_exec() is passed the entire string again, but with startoffset set to 4, it finds the second occurrence of "iss" because it is able to look behind the starting point to discover that it is preceded by a letter. If a non-zero starting offset is passed when the pattern is anchored, one attempt to match at the given offset is tried. This can only suc- ceed if the pattern does not require the match to be at the start of the subject. In general, a pattern matches a certain portion of the subject, and in addition, further substrings from the subject may be picked out by parts of the pattern. Following the usage in Jeffrey Friedl's book, this is called "capturing" in what follows, and the phrase "capturing subpattern" is used for a fragment of a pattern that picks out a sub- string. PCRE supports several other kinds of parenthesized subpattern that do not cause substrings to be captured. Captured substrings are returned to the caller via a vector of integer offsets whose address is passed in ovector. The number of elements in the vector is passed in ovecsize. The first two-thirds of the vector is used to pass back captured substrings, each substring using a pair of integers. The remaining third of the vector is used as workspace by pcre_exec() while matching capturing subpatterns, and is not available for passing back information. The length passed in ovecsize should always be a multiple of three. If it is not, it is rounded down. When a match has been successful, information about captured substrings is returned in pairs of integers, starting at the beginning of ovector, and continuing up to two-thirds of its length at the most. The first element of a pair is set to the offset of the first character in a sub- string, and the second is set to the offset of the first character after the end of a substring. The first pair, ovector[0] and ovec- tor[1], identify the portion of the subject string matched by the entire pattern. The next pair is used for the first capturing subpat- tern, and so on. The value returned by pcre_exec() is the number of pairs that have been set. If there are no capturing subpatterns, the return value from a successful match is 1, indicating that just the first pair of offsets has been set. Some convenience functions are provided for extracting the captured substrings as separate strings. These are described in the following section. It is possible for an capturing subpattern number n+1 to match some part of the subject when subpattern n has not been used at all. For example, if the string "abc" is matched against the pattern (a|(z))(bc) subpatterns 1 and 3 are matched, but 2 is not. When this happens, both offset values corresponding to the unused subpattern are set to -1. If a capturing subpattern is matched repeatedly, it is the last portion of the string that it matched that gets returned. If the vector is too small to hold all the captured substrings, it is used as far as possible (up to two-thirds of its length), and the func- tion returns a value of zero. In particular, if the substring offsets are not of interest, pcre_exec() may be called with ovector passed as NULL and ovecsize as zero. However, if the pattern contains back refer- ences and the ovector isn't big enough to remember the related sub- strings, PCRE has to get additional memory for use during matching. Thus it is usually advisable to supply an ovector. Note that pcre_info() can be used to find out how many capturing sub- patterns there are in a compiled pattern. The smallest size for ovector that will allow for n captured substrings, in addition to the offsets of the substring matched by the whole pattern, is (n+1)*3. If pcre_exec() fails, it returns a negative number. The following are defined in the header file: PCRE_ERROR_NOMATCH (-1) The subject string did not match the pattern. PCRE_ERROR_NULL (-2) Either code or subject was passed as NULL, or ovector was NULL and ovecsize was not zero. PCRE_ERROR_BADOPTION (-3) An unrecognized bit was set in the options argument. PCRE_ERROR_BADMAGIC (-4) PCRE stores a 4-byte "magic number" at the start of the compiled code, to catch the case when it is passed a junk pointer. This is the error it gives when the magic number isn't present. PCRE_ERROR_UNKNOWN_NODE (-5) While running the pattern match, an unknown item was encountered in the compiled pattern. This error could be caused by a bug in PCRE or by overwriting of the compiled pattern. PCRE_ERROR_NOMEMORY (-6) If a pattern contains back references, but the ovector that is passed to pcre_exec() is not big enough to remember the referenced substrings, PCRE gets a block of memory at the start of matching to use for this purpose. If the call via pcre_malloc() fails, this error is given. The memory is freed at the end of matching. PCRE_ERROR_NOSUBSTRING (-7) This error is used by the pcre_copy_substring(), pcre_get_substring(), and pcre_get_substring_list() functions (see below). It is never returned by pcre_exec(). PCRE_ERROR_MATCHLIMIT (-8) The recursion and backtracking limit, as specified by the match_limit field in a pcre_extra structure (or defaulted) was reached. See the description above. PCRE_ERROR_CALLOUT (-9) This error is never generated by pcre_exec() itself. It is provided for use by callout functions that want to yield a distinctive error code. See the pcrecallout documentation for details. PCRE_ERROR_BADUTF8 (-10) A string that contains an invalid UTF-8 byte sequence was passed as a subject. PCRE_ERROR_BADUTF8_OFFSET (-11) The UTF-8 byte sequence that was passed as a subject was valid, but the value of startoffset did not point to the beginning of a UTF-8 charac- ter. EXTRACTING CAPTURED SUBSTRINGS BY NUMBER int pcre_copy_substring(const char *subject, int *ovector, int stringcount, int stringnumber, char *buffer, int buffersize); int pcre_get_substring(const char *subject, int *ovector, int stringcount, int stringnumber, const char **stringptr); int pcre_get_substring_list(const char *subject, int *ovector, int stringcount, const char ***listptr); Captured substrings can be accessed directly by using the offsets returned by pcre_exec() in ovector. For convenience, the functions pcre_copy_substring(), pcre_get_substring(), and pcre_get_sub- string_list() are provided for extracting captured substrings as new, separate, zero-terminated strings. These functions identify substrings by number. The next section describes functions for extracting named substrings. A substring that contains a binary zero is correctly extracted and has a further zero added on the end, but the result is not, of course, a C string. The first three arguments are the same for all three of these func- tions: subject is the subject string which has just been successfully matched, ovector is a pointer to the vector of integer offsets that was passed to pcre_exec(), and stringcount is the number of substrings that were captured by the match, including the substring that matched the entire regular expression. This is the value returned by pcre_exec if it is greater than zero. If pcre_exec() returned zero, indicating that it ran out of space in ovector, the value passed as stringcount should be the size of the vector divided by three. The functions pcre_copy_substring() and pcre_get_substring() extract a single substring, whose number is given as stringnumber. A value of zero extracts the substring that matched the entire pattern, while higher values extract the captured substrings. For pcre_copy_sub- string(), the string is placed in buffer, whose length is given by buffersize, while for pcre_get_substring() a new block of memory is obtained via pcre_malloc, and its address is returned via stringptr. The yield of the function is the length of the string, not including the terminating zero, or one of PCRE_ERROR_NOMEMORY (-6) The buffer was too small for pcre_copy_substring(), or the attempt to get memory failed for pcre_get_substring(). PCRE_ERROR_NOSUBSTRING (-7) There is no substring whose number is stringnumber. The pcre_get_substring_list() function extracts all available sub- strings and builds a list of pointers to them. All this is done in a single block of memory which is obtained via pcre_malloc. The address of the memory block is returned via listptr, which is also the start of the list of string pointers. The end of the list is marked by a NULL pointer. The yield of the function is zero if all went well, or PCRE_ERROR_NOMEMORY (-6) if the attempt to get the memory block failed. When any of these functions encounter a substring that is unset, which can happen when capturing subpattern number n+1 matches some part of the subject, but subpattern n has not been used at all, they return an empty string. This can be distinguished from a genuine zero-length sub- string by inspecting the appropriate offset in ovector, which is nega- tive for unset substrings. The two convenience functions pcre_free_substring() and pcre_free_substring_list() can be used to free the memory returned by a previous call of pcre_get_substring() or pcre_get_substring_list(), respectively. They do nothing more than call the function pointed to by pcre_free, which of course could be called directly from a C program. However, PCRE is used in some situations where it is linked via a spe- cial interface to another programming language which cannot use pcre_free directly; it is for these cases that the functions are pro- vided. EXTRACTING CAPTURED SUBSTRINGS BY NAME int pcre_copy_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, char *buffer, int buffersize); int pcre_get_stringnumber(const pcre *code, const char *name); int pcre_get_named_substring(const pcre *code, const char *subject, int *ovector, int stringcount, const char *stringname, const char **stringptr); To extract a substring by name, you first have to find associated num- ber. This can be done by calling pcre_get_stringnumber(). The first argument is the compiled pattern, and the second is the name. For exam- ple, for this pattern ab(?\d+)... the number of the subpattern called "xxx" is 1. Given the number, you can then extract the substring directly, or use one of the functions described in the previous section. For convenience, there are also two functions that do the whole job. Most of the arguments of pcre_copy_named_substring() and pcre_get_named_substring() are the same as those for the functions that extract by number, and so are not re-described here. There are just two differences. First, instead of a substring number, a substring name is given. Sec- ond, there is an extra argument, given at the start, which is a pointer to the compiled pattern. This is needed in order to gain access to the name-to-number translation table. These functions call pcre_get_stringnumber(), and if it succeeds, they then call pcre_copy_substring() or pcre_get_substring(), as appropri- ate. Last updated: 09 December 2003 Copyright (c) 1997-2003 University of Cambridge. ----------------------------------------------------------------------------- PCRE(3) PCRE(3) NAME PCRE - Perl-compatible regular expressions PCRE CALLOUTS int (*pcre_callout)(pcre_callout_block *); PCRE provides a feature called "callout", which is a means of temporar- ily passing control to the caller of PCRE in the middle of pattern matching. The caller of PCRE provides an external function by putting its entry point in the global variable pcre_callout. By default, this variable contains NULL, which disables all calling out. Within a regular expression, (?C) indicates the points at which the external function is to be called. Different callout points can be identified by putting a number less than 256 after the letter C. The default value is zero. For example, this pattern has two callout points: (?C1)abc(?C2)def During matching, when PCRE reaches a callout point (and pcre_callout is set), the external function is called. Its only argument is a pointer to a pcre_callout block. This contains the following variables: int version; int callout_number; int *offset_vector; const char *subject; int subject_length; int start_match; int current_position; int capture_top; int capture_last; void *callout_data; The version field is an integer containing the version number of the block format. The current version is zero. The version number may change in future if additional fields are added, but the intention is never to remove any of the existing fields. The callout_number field contains the number of the callout, as com- piled into the pattern (that is, the number after ?C). The offset_vector field is a pointer to the vector of offsets that was passed by the caller to pcre_exec(). The contents can be inspected in order to extract substrings that have been matched so far, in the same way as for extracting substrings after a match has completed. The subject and subject_length fields contain copies the values that were passed to pcre_exec(). The start_match field contains the offset within the subject at which the current match attempt started. If the pattern is not anchored, the callout function may be called several times for different starting points. The current_position field contains the offset within the subject of the current match pointer. The capture_top field contains one more than the number of the highest numbered captured substring so far. If no substrings have been captured, the value of capture_top is one. The capture_last field contains the number of the most recently cap- tured substring. The callout_data field contains a value that is passed to pcre_exec() by the caller specifically so that it can be passed back in callouts. It is passed in the pcre_callout field of the pcre_extra data struc- ture. If no such data was passed, the value of callout_data in a pcre_callout block is NULL. There is a description of the pcre_extra structure in the pcreapi documentation. RETURN VALUES The callout function returns an integer. If the value is zero, matching proceeds as normal. If the value is greater than zero, matching fails at the current point, but backtracking to test other possibilities goes ahead, just as if a lookahead assertion had failed. If the value is less than zero, the match is abandoned, and pcre_exec() returns the value. Negative values should normally be chosen from the set of PCRE_ERROR_xxx values. In particular, PCRE_ERROR_NOMATCH forces a stan- dard "no match" failure. The error number PCRE_ERROR_CALLOUT is reserved for use by callout functions; it will never be used by PCRE itself. Last updated: 21 January 2003 Copyright (c) 1997-2003 University of Cambridge. ----------------------------------------------------------------------------- PCRE(3) PCRE(3) NAME PCRE - Perl-compatible regular expressions DIFFERENCES FROM PERL This document describes the differences in the ways that PCRE and Perl handle regular expressions. The differences described here are with respect to Perl 5.8. 1. PCRE does not have full UTF-8 support. Details of what it does have are given in the section on UTF-8 support in the main pcre page. 2. PCRE does not allow repeat quantifiers on lookahead assertions. Perl permits them, but they do not mean what you might think. For example, (?!a){3} does not assert that the next three characters are not "a". It just asserts that the next character is not "a" three times. 3. Capturing subpatterns that occur inside negative lookahead asser- tions are counted, but their entries in the offsets vector are never set. Perl sets its numerical variables from any such patterns that are matched before the assertion fails to match something (thereby succeed- ing), but only if the negative lookahead assertion contains just one branch. 4. Though binary zero characters are supported in the subject string, they are not allowed in a pattern string because it is passed as a nor- mal C string, terminated by zero. The escape sequence "\0" can be used in the pattern to represent a binary zero. 5. The following Perl escape sequences are not supported: \l, \u, \L, \U, \P, \p, \N, and \X. In fact these are implemented by Perl's general string-handling and are not part of its pattern matching engine. If any of these are encountered by PCRE, an error is generated. 6. PCRE does support the \Q...\E escape for quoting substrings. Charac- ters in between are treated as literals. This is slightly different from Perl in that $ and @ are also handled as literals inside the quotes. In Perl, they cause variable interpolation (but of course PCRE does not have variables). Note the following examples: Pattern PCRE matches Perl matches \Qabc$xyz\E abc$xyz abc followed by the contents of $xyz \Qabc\$xyz\E abc\$xyz abc\$xyz \Qabc\E\$\Qxyz\E abc$xyz abc$xyz The \Q...\E sequence is recognized both inside and outside character classes. 7. Fairly obviously, PCRE does not support the (?{code}) and (?p{code}) constructions. However, there is some experimental support for recur- sive patterns using the non-Perl items (?R), (?number) and (?P>name). Also, the PCRE "callout" feature allows an external function to be called during pattern matching. 8. There are some differences that are concerned with the settings of captured strings when part of a pattern is repeated. For example, matching "aba" against the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE it is set to "b". 9. PCRE provides some extensions to the Perl regular expression facilities: (a) Although lookbehind assertions must match fixed length strings, each alternative branch of a lookbehind assertion can match a different length of string. Perl requires them all to have the same length. (b) If PCRE_DOLLAR_ENDONLY is set and PCRE_MULTILINE is not set, the $ meta-character matches only at the very end of the string. (c) If PCRE_EXTRA is set, a backslash followed by a letter with no spe- cial meaning is faulted. (d) If PCRE_UNGREEDY is set, the greediness of the repetition quanti- fiers is inverted, that is, by default they are not greedy, but if fol- lowed by a question mark they are. (e) PCRE_ANCHORED can be used to force a pattern to be tried only at the first matching position in the subject string. (f) The PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, and PCRE_NO_AUTO_CAP- TURE options for pcre_exec() have no Perl equivalents. (g) The (?R), (?number), and (?P>name) constructs allows for recursive pattern matching (Perl can do this using the (?p{code}) construct, which PCRE cannot support.) (h) PCRE supports named capturing substrings, using the Python syntax. (i) PCRE supports the possessive quantifier "++" syntax, taken from Sun's Java package. (j) The (R) condition, for testing recursion, is a PCRE extension. (k) The callout facility is PCRE-specific. Last updated: 09 December 2003 Copyright (c) 1997-2003 University of Cambridge. ----------------------------------------------------------------------------- PCRE(3) PCRE(3) NAME PCRE - Perl-compatible regular expressions PCRE REGULAR EXPRESSION DETAILS The syntax and semantics of the regular expressions supported by PCRE are described below. Regular expressions are also described in the Perl documentation and in a number of other books, some of which have copi- ous examples. Jeffrey Friedl's "Mastering Regular Expressions", pub- lished by O'Reilly, covers them in great detail. The description here is intended as reference documentation. The basic operation of PCRE is on strings of bytes. However, there is also support for UTF-8 character strings. To use this support you must build PCRE to include UTF-8 support, and then call pcre_compile() with the PCRE_UTF8 option. How this affects the pattern matching is men- tioned in several places below. There is also a summary of UTF-8 fea- tures in the section on UTF-8 support in the main pcre page. A regular expression is a pattern that is matched against a subject string from left to right. Most characters stand for themselves in a pattern, and match the corresponding characters in the subject. As a trivial example, the pattern The quick brown fox matches a portion of a subject string that is identical to itself. The power of regular expressions comes from the ability to include alterna- tives and repetitions in the pattern. These are encoded in the pattern by the use of meta-characters, which do not stand for themselves but instead are interpreted in some special way. There are two different sets of meta-characters: those that are recog- nized anywhere in the pattern except within square brackets, and those that are recognized in square brackets. Outside square brackets, the meta-characters are as follows: \ general escape character with several uses ^ assert start of string (or line, in multiline mode) $ assert end of string (or line, in multiline mode) . match any character except newline (by default) [ start character class definition | start of alternative branch ( start subpattern ) end subpattern ? extends the meaning of ( also 0 or 1 quantifier also quantifier minimizer * 0 or more quantifier + 1 or more quantifier also "possessive quantifier" { start min/max quantifier Part of a pattern that is in square brackets is called a "character class". In a character class the only meta-characters are: \ general escape character ^ negate the class, but only if the first character - indicates character range [ POSIX character class (only if followed by POSIX syntax) ] terminates the character class The following sections describe the use of each of the meta-characters. BACKSLASH The backslash character has several uses. Firstly, if it is followed by a non-alphameric character, it takes away any special meaning that character may have. This use of backslash as an escape character applies both inside and outside character classes. For example, if you want to match a * character, you write \* in the pattern. This escaping action applies whether or not the following character would otherwise be interpreted as a meta-character, so it is always safe to precede a non-alphameric with backslash to specify that it stands for itself. In particular, if you want to match a backslash, you write \\. If a pattern is compiled with the PCRE_EXTENDED option, whitespace in the pattern (other than in a character class) and characters between a # outside a character class and the next newline character are ignored. An escaping backslash can be used to include a whitespace or # charac- ter as part of the pattern. If you want to remove the special meaning from a sequence of charac- ters, you can do so by putting them between \Q and \E. This is differ- ent from Perl in that $ and @ are handled as literals in \Q...\E sequences in PCRE, whereas in Perl, $ and @ cause variable interpola- tion. Note the following examples: Pattern PCRE matches Perl matches \Qabc$xyz\E abc$xyz abc followed by the contents of $xyz \Qabc\$xyz\E abc\$xyz abc\$xyz \Qabc\E\$\Qxyz\E abc$xyz abc$xyz The \Q...\E sequence is recognized both inside and outside character classes. A second use of backslash provides a way of encoding non-printing char- acters in patterns in a visible manner. There is no restriction on the appearance of non-printing characters, apart from the binary zero that terminates a pattern, but when a pattern is being prepared by text editing, it is usually easier to use one of the following escape sequences than the binary character it represents: \a alarm, that is, the BEL character (hex 07) \cx "control-x", where x is any character \e escape (hex 1B) \f formfeed (hex 0C) \n newline (hex 0A) \r carriage return (hex 0D) \t tab (hex 09) \ddd character with octal code ddd, or backreference \xhh character with hex code hh \x{hhh..} character with hex code hhh... (UTF-8 mode only) The precise effect of \cx is as follows: if x is a lower case letter, it is converted to upper case. Then bit 6 of the character (hex 40) is inverted. Thus \cz becomes hex 1A, but \c{ becomes hex 3B, while \c; becomes hex 7B. After \x, from zero to two hexadecimal digits are read (letters can be in upper or lower case). In UTF-8 mode, any number of hexadecimal dig- its may appear between \x{ and }, but the value of the character code must be less than 2**31 (that is, the maximum hexadecimal value is 7FFFFFFF). If characters other than hexadecimal digits appear between \x{ and }, or if there is no terminating }, this form of escape is not recognized. Instead, the initial \x will be interpreted as a basic hex- adecimal escape, with no following digits, giving a byte whose value is zero. Characters whose value is less than 256 can be defined by either of the two syntaxes for \x when PCRE is in UTF-8 mode. There is no difference in the way they are handled. For example, \xdc is exactly the same as \x{dc}. After \0 up to two further octal digits are read. In both cases, if there are fewer than two digits, just those that are present are used. Thus the sequence \0\x\07 specifies two binary zeros followed by a BEL character (code value 7). Make sure you supply two digits after the initial zero if the character that follows is itself an octal digit. The handling of a backslash followed by a digit other than 0 is compli- cated. Outside a character class, PCRE reads it and any following dig- its as a decimal number. If the number is less than 10, or if there have been at least that many previous capturing left parentheses in the expression, the entire sequence is taken as a back reference. A description of how this works is given later, following the discussion of parenthesized subpatterns. Inside a character class, or if the decimal number is greater than 9 and there have not been that many capturing subpatterns, PCRE re-reads up to three octal digits following the backslash, and generates a sin- gle byte from the least significant 8 bits of the value. Any subsequent digits stand for themselves. For example: \040 is another way of writing a space \40 is the same, provided there are fewer than 40 previous capturing subpatterns \7 is always a back reference \11 might be a back reference, or another way of writing a tab \011 is always a tab \0113 is a tab followed by the character "3" \113 might be a back reference, otherwise the character with octal code 113 \377 might be a back reference, otherwise the byte consisting entirely of 1 bits \81 is either a back reference, or a binary zero followed by the two characters "8" and "1" Note that octal values of 100 or greater must not be introduced by a leading zero, because no more than three octal digits are ever read. All the sequences that define a single byte value or a single UTF-8 character (in UTF-8 mode) can be used both inside and outside character classes. In addition, inside a character class, the sequence \b is interpreted as the backspace character (hex 08). Outside a character class it has a different meaning (see below). The third use of backslash is for specifying generic character types: \d any decimal digit \D any character that is not a decimal digit \s any whitespace character \S any character that is not a whitespace character \w any "word" character \W any "non-word" character Each pair of escape sequences partitions the complete set of characters into two disjoint sets. Any given character matches one, and only one, of each pair. In UTF-8 mode, characters with values greater than 255 never match \d, \s, or \w, and always match \D, \S, and \W. For compatibility with Perl, \s does not match the VT character (code 11). This makes it different from the the POSIX "space" class. The \s characters are HT (9), LF (10), FF (12), CR (13), and space (32). A "word" character is any letter or digit or the underscore character, that is, any character which can be part of a Perl "word". The defini- tion of letters and digits is controlled by PCRE's character tables, and may vary if locale- specific matching is taking place (see "Locale support" in the pcreapi page). For example, in the "fr" (French) locale, some character codes greater than 128 are used for accented letters, and these are matched by \w. These character type sequences can appear both inside and outside char- acter classes. They each match one character of the appropriate type. If the current matching point is at the end of the subject string, all of them fail, since there is no character to match. The fourth use of backslash is for certain simple assertions. An asser- tion specifies a condition that has to be met at a particular point in a match, without consuming any characters from the subject string. The use of subpatterns for more complicated assertions is described below. The backslashed assertions are \b matches at a word boundary \B matches when not at a word boundary \A matches at start of subject \Z matches at end of subject or before newline at end \z matches at end of subject \G matches at first matching position in subject These assertions may not appear in character classes (but note that \b has a different meaning, namely the backspace character, inside a char- acter class). A word boundary is a position in the subject string where the current character and the previous character do not both match \w or \W (i.e. one matches \w and the other matches \W), or the start or end of the string if the first or last character matches \w, respectively. The \A, \Z, and \z assertions differ from the traditional circumflex and dollar (described below) in that they only ever match at the very start and end of the subject string, whatever options are set. Thus, they are independent of multiline mode. They are not affected by the PCRE_NOTBOL or PCRE_NOTEOL options. If the startoffset argument of pcre_exec() is non-zero, indicating that match- ing is to start at a point other than the beginning of the subject, \A can never match. The difference between \Z and \z is that \Z matches before a newline that is the last character of the string as well as at the end of the string, whereas \z matches only at the end. The \G assertion is true only when the current matching position is at the start point of the match, as specified by the startoffset argument of pcre_exec(). It differs from \A when the value of startoffset is non-zero. By calling pcre_exec() multiple times with appropriate argu- ments, you can mimic Perl's /g option, and it is in this kind of imple- mentation where \G can be useful. Note, however, that PCRE's interpretation of \G, as the start of the current match, is subtly different from Perl's, which defines it as the end of the previous match. In Perl, these can be different when the previously matched string was empty. Because PCRE does just one match at a time, it cannot reproduce this behaviour. If all the alternatives of a pattern begin with \G, the expression is anchored to the starting match position, and the "anchored" flag is set in the compiled regular expression. CIRCUMFLEX AND DOLLAR Outside a character class, in the default matching mode, the circumflex character is an assertion which is true only if the current matching point is at the start of the subject string. If the startoffset argu- ment of pcre_exec() is non-zero, circumflex can never match if the PCRE_MULTILINE option is unset. Inside a character class, circumflex has an entirely different meaning (see below). Circumflex need not be the first character of the pattern if a number of alternatives are involved, but it should be the first thing in each alternative in which it appears if the pattern is ever to match that branch. If all possible alternatives start with a circumflex, that is, if the pattern is constrained to match only at the start of the sub- ject, it is said to be an "anchored" pattern. (There are also other constructs that can cause a pattern to be anchored.) A dollar character is an assertion which is true only if the current matching point is at the end of the subject string, or immediately before a newline character that is the last character in the string (by default). Dollar need not be the last character of the pattern if a number of alternatives are involved, but it should be the last item in any branch in which it appears. Dollar has no special meaning in a character class. The meaning of dollar can be changed so that it matches only at the very end of the string, by setting the PCRE_DOLLAR_ENDONLY option at compile time. This does not affect the \Z assertion. The meanings of the circumflex and dollar characters are changed if the PCRE_MULTILINE option is set. When this is the case, they match immedi- ately after and immediately before an internal newline character, respectively, in addition to matching at the start and end of the sub- ject string. For example, the pattern /^abc$/ matches the subject string "def\nabc" in multiline mode, but not otherwise. Consequently, patterns that are anchored in single line mode because all branches start with ^ are not anchored in multiline mode, and a match for cir- cumflex is possible when the startoffset argument of pcre_exec() is non-zero. The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is set. Note that the sequences \A, \Z, and \z can be used to match the start and end of the subject in both modes, and if all branches of a pattern start with \A it is always anchored, whether PCRE_MULTILINE is set or not. FULL STOP (PERIOD, DOT) Outside a character class, a dot in the pattern matches any one charac- ter in the subject, including a non-printing character, but not (by default) newline. In UTF-8 mode, a dot matches any UTF-8 character, which might be more than one byte long, except (by default) for new- line. If the PCRE_DOTALL option is set, dots match newlines as well. The handling of dot is entirely independent of the handling of circum- flex and dollar, the only relationship being that they both involve newline characters. Dot has no special meaning in a character class. MATCHING A SINGLE BYTE Outside a character class, the escape sequence \C matches any one byte, both in and out of UTF-8 mode. Unlike a dot, it always matches a new- line. The feature is provided in Perl in order to match individual bytes in UTF-8 mode. Because it breaks up UTF-8 characters into indi- vidual bytes, what remains in the string may be a malformed UTF-8 string. For this reason it is best avoided. PCRE does not allow \C to appear in lookbehind assertions (see below), because in UTF-8 mode it makes it impossible to calculate the length of the lookbehind. SQUARE BRACKETS An opening square bracket introduces a character class, terminated by a closing square bracket. A closing square bracket on its own is not spe- cial. If a closing square bracket is required as a member of the class, it should be the first data character in the class (after an initial circumflex, if present) or escaped with a backslash. A character class matches a single character in the subject. In UTF-8 mode, the character may occupy more than one byte. A matched character must be in the set of characters defined by the class, unless the first character in the class definition is a circumflex, in which case the subject character must not be in the set defined by the class. If a circumflex is actually required as a member of the class, ensure it is not the first character, or escape it with a backslash. For example, the character class [aeiou] matches any lower case vowel, while [^aeiou] matches any character that is not a lower case vowel. Note that a circumflex is just a convenient notation for specifying the characters which are in the class by enumerating those that are not. It is not an assertion: it still consumes a character from the subject string, and fails if the current pointer is at the end of the string. In UTF-8 mode, characters with values greater than 255 can be included in a class as a literal string of bytes, or by using the \x{ escaping mechanism. When caseless matching is set, any letters in a class represent both their upper case and lower case versions, so for example, a caseless [aeiou] matches "A" as well as "a", and a caseless [^aeiou] does not match "A", whereas a caseful version would. PCRE does not support the concept of case for characters with values greater than 255. The newline character is never treated in any special way in character classes, whatever the setting of the PCRE_DOTALL or PCRE_MULTILINE options is. A class such as [^a] will always match a newline. The minus (hyphen) character can be used to specify a range of charac- ters in a character class. For example, [d-m] matches any letter between d and m, inclusive. If a minus character is required in a class, it must be escaped with a backslash or appear in a position where it cannot be interpreted as indicating a range, typically as the first or last character in the class. It is not possible to have the literal character "]" as the end charac- ter of a range. A pattern such as [W-]46] is interpreted as a class of two characters ("W" and "-") followed by a literal string "46]", so it would match "W46]" or "-46]". However, if the "]" is escaped with a backslash it is interpreted as the end of range, so [W-\]46] is inter- preted as a single class containing a range followed by two separate characters. The octal or hexadecimal representation of "]" can also be used to end a range. Ranges operate in the collating sequence of character values. They can also be used for characters specified numerically, for example [\000-\037]. In UTF-8 mode, ranges can include characters whose values are greater than 255, for example [\x{100}-\x{2ff}]. If a range that includes letters is used when caseless matching is set, it matches the letters in either case. For example, [W-c] is equivalent to [][\^_`wxyzabc], matched caselessly, and if character tables for the "fr" locale are in use, [\xc8-\xcb] matches accented E characters in both cases. The character types \d, \D, \s, \S, \w, and \W may also appear in a character class, and add the characters that they match to the class. For example, [\dABCDEF] matches any hexadecimal digit. A circumflex can conveniently be used with the upper case character types to specify a more restricted set of characters than the matching lower case type. For example, the class [^\W_] matches any letter or digit, but not underscore. All non-alphameric characters other than \, -, ^ (at the start) and the terminating ] are non-special in character classes, but it does no harm if they are escaped. POSIX CHARACTER CLASSES Perl supports the POSIX notation for character classes, which uses names enclosed by [: and :] within the enclosing square brackets. PCRE also supports this notation. For example, [01[:alpha:]%] matches "0", "1", any alphabetic character, or "%". The supported class names are alnum letters and digits alpha letters ascii character codes 0 - 127 blank space or tab only cntrl control characters digit decimal digits (same as \d) graph printing characters, excluding space lower lower case letters print printing characters, including space punct printing characters, excluding letters and digits space white space (not quite the same as \s) upper upper case letters word "word" characters (same as \w) xdigit hexadecimal digits The "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), and space (32). Notice that this list includes the VT character (code 11). This makes "space" different to \s, which does not include VT (for Perl compatibility). The name "word" is a Perl extension, and "blank" is a GNU extension from Perl 5.8. Another Perl extension is negation, which is indicated by a ^ character after the colon. For example, [12[:^digit:]] matches "1", "2", or any non-digit. PCRE (and Perl) also recognize the POSIX syntax [.ch.] and [=ch=] where "ch" is a "collating element", but these are not supported, and an error is given if they are encountered. In UTF-8 mode, characters with values greater than 255 do not match any of the POSIX character classes. VERTICAL BAR Vertical bar characters are used to separate alternative patterns. For example, the pattern gilbert|sullivan matches either "gilbert" or "sullivan". Any number of alternatives may appear, and an empty alternative is permitted (matching the empty string). The matching process tries each alternative in turn, from left to right, and the first one that succeeds is used. If the alterna- tives are within a subpattern (defined below), "succeeds" means match- ing the rest of the main pattern as well as the alternative in the sub- pattern. INTERNAL OPTION SETTING The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and PCRE_EXTENDED options can be changed from within the pattern by a sequence of Perl option letters enclosed between "(?" and ")". The option letters are i for PCRE_CASELESS m for PCRE_MULTILINE s for PCRE_DOTALL x for PCRE_EXTENDED For example, (?im) sets caseless, multiline matching. It is also possi- ble to unset these options by preceding the letter with a hyphen, and a combined setting and unsetting such as (?im-sx), which sets PCRE_CASE- LESS and PCRE_MULTILINE while unsetting PCRE_DOTALL and PCRE_EXTENDED, is also permitted. If a letter appears both before and after the hyphen, the option is unset. When an option change occurs at top level (that is, not inside subpat- tern parentheses), the change applies to the remainder of the pattern that follows. If the change is placed right at the start of a pattern, PCRE extracts it into the global options (and it will therefore show up in data extracted by the pcre_fullinfo() function). An option change within a subpattern affects only that part of the cur- rent pattern that follows it, so (a(?i)b)c matches abc and aBc and no other strings (assuming PCRE_CASELESS is not used). By this means, options can be made to have different settings in different parts of the pattern. Any changes made in one alternative do carry on into subsequent branches within the same subpattern. For example, (a(?i)b|c) matches "ab", "aB", "c", and "C", even though when matching "C" the first branch is abandoned before the option setting. This is because the effects of option settings happen at compile time. There would be some very weird behaviour otherwise. The PCRE-specific options PCRE_UNGREEDY and PCRE_EXTRA can be changed in the same way as the Perl-compatible options by using the characters U and X respectively. The (?X) flag setting is special in that it must always occur earlier in the pattern than any of the additional features it turns on, even when it is at top level. It is best put at the start. SUBPATTERNS Subpatterns are delimited by parentheses (round brackets), which can be nested. Marking part of a pattern as a subpattern does two things: 1. It localizes a set of alternatives. For example, the pattern cat(aract|erpillar|) matches one of the words "cat", "cataract", or "caterpillar". Without the parentheses, it would match "cataract", "erpillar" or the empty string. 2. It sets up the subpattern as a capturing subpattern (as defined above). When the whole pattern matches, that portion of the subject string that matched the subpattern is passed back to the caller via the ovector argument of pcre_exec(). Opening parentheses are counted from left to right (starting from 1) to obtain the numbers of the capturing subpatterns. For example, if the string "the red king" is matched against the pat- tern the ((red|white) (king|queen)) the captured substrings are "red king", "red", and "king", and are num- bered 1, 2, and 3, respectively. The fact that plain parentheses fulfil two functions is not always helpful. There are often times when a grouping subpattern is required without a capturing requirement. If an opening parenthesis is followed by a question mark and a colon, the subpattern does not do any captur- ing, and is not counted when computing the number of any subsequent capturing subpatterns. For example, if the string "the white queen" is matched against the pattern the ((?:red|white) (king|queen)) the captured substrings are "white queen" and "queen", and are numbered 1 and 2. The maximum number of capturing subpatterns is 65535, and the maximum depth of nesting of all subpatterns, both capturing and non- capturing, is 200. As a convenient shorthand, if any option settings are required at the start of a non-capturing subpattern, the option letters may appear between the "?" and the ":". Thus the two patterns (?i:saturday|sunday) (?:(?i)saturday|sunday) match exactly the same set of strings. Because alternative branches are tried from left to right, and options are not reset until the end of the subpattern is reached, an option setting in one branch does affect subsequent branches, so the above patterns match "SUNDAY" as well as "Saturday". NAMED SUBPATTERNS Identifying capturing parentheses by number is simple, but it can be very hard to keep track of the numbers in complicated regular expres- sions. Furthermore, if an expression is modified, the numbers may change. To help with the difficulty, PCRE supports the naming of sub- patterns, something that Perl does not provide. The Python syntax (?P...) is used. Names consist of alphanumeric characters and underscores, and must be unique within a pattern. Named capturing parentheses are still allocated numbers as well as names. The PCRE API provides function calls for extracting the name-to- number translation table from a compiled pattern. For further details see the pcreapi documentation. REPETITION Repetition is specified by quantifiers, which can follow any of the following items: a literal data character the . metacharacter the \C escape sequence escapes such as \d that match single characters a character class a back reference (see next section) a parenthesized subpattern (unless it is an assertion) The general repetition quantifier specifies a minimum and maximum num- ber of permitted matches, by giving the two numbers in curly brackets (braces), separated by a comma. The numbers must be less than 65536, and the first must be less than or equal to the second. For example: z{2,4} matches "zz", "zzz", or "zzzz". A closing brace on its own is not a special character. If the second number is omitted, but the comma is present, there is no upper limit; if the second number and the comma are both omitted, the quantifier specifies an exact number of required matches. Thus [aeiou]{3,} matches at least 3 successive vowels, but may match many more, while \d{8} matches exactly 8 digits. An opening curly bracket that appears in a position where a quantifier is not allowed, or one that does not match the syntax of a quantifier, is taken as a literal character. For exam- ple, {,6} is not a quantifier, but a literal string of four characters. In UTF-8 mode, quantifiers apply to UTF-8 characters rather than to individual bytes. Thus, for example, \x{100}{2} matches two UTF-8 char- acters, each of which is represented by a two-byte sequence. The quantifier {0} is permitted, causing the expression to behave as if the previous item and the quantifier were not present. For convenience (and historical compatibility) the three most common quantifiers have single-character abbreviations: * is equivalent to {0,} + is equivalent to {1,} ? is equivalent to {0,1} It is possible to construct infinite loops by following a subpattern that can match no characters with a quantifier that has no upper limit, for example: (a?)* Earlier versions of Perl and PCRE used to give an error at compile time for such patterns. However, because there are cases where this can be useful, such patterns are now accepted, but if any repetition of the subpattern does in fact match no characters, the loop is forcibly bro- ken. By default, the quantifiers are "greedy", that is, they match as much as possible (up to the maximum number of permitted times), without causing the rest of the pattern to fail. The classic example of where this gives problems is in trying to match comments in C programs. These appear between the sequences /* and */ and within the sequence, indi- vidual * and / characters may appear. An attempt to match C comments by applying the pattern /\*.*\*/ to the string /* first command */ not comment /* second comment */ fails, because it matches the entire string owing to the greediness of the .* item. However, if a quantifier is followed by a question mark, it ceases to be greedy, and instead matches the minimum number of times possible, so the pattern /\*.*?\*/ does the right thing with the C comments. The meaning of the various quantifiers is not otherwise changed, just the preferred number of matches. Do not confuse this use of question mark with its use as a quantifier in its own right. Because it has two uses, it can sometimes appear doubled, as in \d??\d which matches one digit by preference, but can match two if that is the only way the rest of the pattern matches. If the PCRE_UNGREEDY option is set (an option which is not available in Perl), the quantifiers are not greedy by default, but individual ones can be made greedy by following them with a question mark. In other words, it inverts the default behaviour. When a parenthesized subpattern is quantified with a minimum repeat count that is greater than 1 or with a limited maximum, more store is required for the compiled pattern, in proportion to the size of the minimum or maximum. If a pattern starts with .* or .{0,} and the PCRE_DOTALL option (equiv- alent to Perl's /s) is set, thus allowing the . to match newlines, the pattern is implicitly anchored, because whatever follows will be tried against every character position in the subject string, so there is no point in retrying the overall match at any position after the first. PCRE normally treats such a pattern as though it were preceded by \A. In cases where it is known that the subject string contains no new- lines, it is worth setting PCRE_DOTALL in order to obtain this opti- mization, or alternatively using ^ to indicate anchoring explicitly. However, there is one situation where the optimization cannot be used. When .* is inside capturing parentheses that are the subject of a backreference elsewhere in the pattern, a match at the start may fail, and a later one succeed. Consider, for example: (.*)abc\1 If the subject is "xyz123abc123" the match point is the fourth charac- ter. For this reason, such a pattern is not implicitly anchored. When a capturing subpattern is repeated, the value captured is the sub- string that matched the final iteration. For example, after (tweedle[dume]{3}\s*)+ has matched "tweedledum tweedledee" the value of the captured substring is "tweedledee". However, if there are nested capturing subpatterns, the corresponding captured values may have been set in previous itera- tions. For example, after /(a|(b))+/ matches "aba" the value of the second captured substring is "b". ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS With both maximizing and minimizing repetition, failure of what follows normally causes the repeated item to be re-evaluated to see if a dif- ferent number of repeats allows the rest of the pattern to match. Some- times it is useful to prevent this, either to change the nature of the match, or to cause it fail earlier than it otherwise might, when the author of the pattern knows there is no point in carrying on. Consider, for example, the pattern \d+foo when applied to the subject line 123456bar After matching all 6 digits and then failing to match "foo", the normal action of the matcher is to try again with only 5 digits matching the \d+ item, and then with 4, and so on, before ultimately failing. "Atomic grouping" (a term taken from Jeffrey Friedl's book) provides the means for specifying that once a subpattern has matched, it is not to be re-evaluated in this way. If we use atomic grouping for the previous example, the matcher would give up immediately on failing to match "foo" the first time. The nota- tion is a kind of special parenthesis, starting with (?> as in this example: (?>\d+)foo This kind of parenthesis "locks up" the part of the pattern it con- tains once it has matched, and a failure further into the pattern is prevented from backtracking into it. Backtracking past it to previous items, however, works as normal. An alternative description is that a subpattern of this type matches the string of characters that an identical standalone pattern would match, if anchored at the current point in the subject string. Atomic grouping subpatterns are not capturing subpatterns. Simple cases such as the above example can be thought of as a maximizing repeat that must swallow everything it can. So, while both \d+ and \d+? are pre- pared to adjust the number of digits they match in order to make the rest of the pattern match, (?>\d+) can only match an entire sequence of digits. Atomic groups in general can of course contain arbitrarily complicated subpatterns, and can be nested. However, when the subpattern for an atomic group is just a single repeated item, as in the example above, a simpler notation, called a "possessive quantifier" can be used. This consists of an additional + character following a quantifier. Using this notation, the previous example can be rewritten as \d++bar Possessive quantifiers are always greedy; the setting of the PCRE_UNGREEDY option is ignored. They are a convenient notation for the simpler forms of atomic group. However, there is no difference in the meaning or processing of a possessive quantifier and the equivalent atomic group. The possessive quantifier syntax is an extension to the Perl syntax. It originates in Sun's Java package. When a pattern contains an unlimited repeat inside a subpattern that can itself be repeated an unlimited number of times, the use of an atomic group is the only way to avoid some failing matches taking a very long time indeed. The pattern (\D+|<\d+>)*[!?] matches an unlimited number of substrings that either consist of non- digits, or digits enclosed in <>, followed by either ! or ?. When it matches, it runs quickly. However, if it is applied to aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa it takes a long time before reporting failure. This is because the string can be divided between the two repeats in a large number of ways, and all have to be tried. (The example used [!?] rather than a single character at the end, because both PCRE and Perl have an opti- mization that allows for fast failure when a single character is used. They remember the last single character that is required for a match, and fail early if it is not present in the string.) If the pattern is changed to ((?>\D+)|<\d+>)*[!?] sequences of non-digits cannot be broken, and failure happens quickly. BACK REFERENCES Outside a character class, a backslash followed by a digit greater than 0 (and possibly further digits) is a back reference to a capturing sub- pattern earlier (that is, to its left) in the pattern, provided there have been that many previous capturing left parentheses. However, if the decimal number following the backslash is less than 10, it is always taken as a back reference, and causes an error only if there are not that many capturing left parentheses in the entire pat- tern. In other words, the parentheses that are referenced need not be to the left of the reference for numbers less than 10. See the section entitled "Backslash" above for further details of the handling of dig- its following a backslash. A back reference matches whatever actually matched the capturing sub- pattern in the current subject string, rather than anything matching the subpattern itself (see "Subpatterns as subroutines" below for a way of doing that). So the pattern (sens|respons)e and \1ibility matches "sense and sensibility" and "response and responsibility", but not "sense and responsibility". If caseful matching is in force at the time of the back reference, the case of letters is relevant. For exam- ple, ((?i)rah)\s+\1 matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original capturing subpattern is matched caselessly. Back references to named subpatterns use the Python syntax (?P=name). We could rewrite the above example as follows: (?(?i)rah)\s+(?P=p1) There may be more than one back reference to the same subpattern. If a subpattern has not actually been used in a particular match, any back references to it always fail. For example, the pattern (a|(bc))\2 always fails if it starts to match "a" rather than "bc". Because there may be many capturing parentheses in a pattern, all digits following the backslash are taken as part of a potential back reference number. If the pattern continues with a digit character, some delimiter must be used to terminate the back reference. If the PCRE_EXTENDED option is set, this can be whitespace. Otherwise an empty comment can be used. A back reference that occurs inside the parentheses to which it refers fails when the subpattern is first used, so, for example, (a\1) never matches. However, such references can be useful inside repeated sub- patterns. For example, the pattern (a|b\1)+ matches any number of "a"s and also "aba", "ababbaa" etc. At each iter- ation of the subpattern, the back reference matches the character string corresponding to the previous iteration. In order for this to work, the pattern must be such that the first iteration does not need to match the back reference. This can be done using alternation, as in the example above, or by a quantifier with a minimum of zero. ASSERTIONS An assertion is a test on the characters following or preceding the current matching point that does not actually consume any characters. The simple assertions coded as \b, \B, \A, \G, \Z, \z, ^ and $ are described above. More complicated assertions are coded as subpatterns. There are two kinds: those that look ahead of the current position in the subject string, and those that look behind it. An assertion subpattern is matched in the normal way, except that it does not cause the current matching position to be changed. Lookahead assertions start with (?= for positive assertions and (?! for negative assertions. For example, \w+(?=;) matches a word followed by a semicolon, but does not include the semi- colon in the match, and foo(?!bar) matches any occurrence of "foo" that is not followed by "bar". Note that the apparently similar pattern (?!foo)bar does not find an occurrence of "bar" that is preceded by something other than "foo"; it finds any occurrence of "bar" whatsoever, because the assertion (?!foo) is always true when the next three characters are "bar". A lookbehind assertion is needed to achieve this effect. If you want to force a matching failure at some point in a pattern, the most convenient way to do it is with (?!) because an empty string always matches, so an assertion that requires there not to be an empty string must always fail. Lookbehind assertions start with (?<= for positive assertions and (?.*)(?<=abcd) or, equivalently, ^.*+(?<=abcd) there can be no backtracking for the .* item; it can match only the entire string. The subsequent lookbehind assertion does a single test on the last four characters. If it fails, the match fails immediately. For long strings, this approach makes a significant difference to the processing time. Several assertions (of any sort) may occur in succession. For example, (?<=\d{3})(?[^()]+) | (?p{$re}) )* \)}x; The (?p{...}) item interpolates Perl code at run time, and in this case refers recursively to the pattern in which it appears. Obviously, PCRE cannot support the interpolation of Perl code. Instead, it supports some special syntax for recursion of the entire pattern, and also for individual subpattern recursion. The special item that consists of (? followed by a number greater than zero and a closing parenthesis is a recursive call of the subpattern of the given number, provided that it occurs inside that subpattern. (If not, it is a "subroutine" call, which is described in the next sec- tion.) The special item (?R) is a recursive call of the entire regular expression. For example, this PCRE pattern solves the nested parentheses problem (assume the PCRE_EXTENDED option is set so that white space is ignored): \( ( (?>[^()]+) | (?R) )* \) First it matches an opening parenthesis. Then it matches any number of substrings which can either be a sequence of non-parentheses, or a recursive match of the pattern itself (that is a correctly parenthe- sized substring). Finally there is a closing parenthesis. If this were part of a larger pattern, you would not want to recurse the entire pattern, so instead you could use this: ( \( ( (?>[^()]+) | (?1) )* \) ) We have put the pattern into parentheses, and caused the recursion to refer to them instead of the whole pattern. In a larger pattern, keep- ing track of parenthesis numbers can be tricky. It may be more conve- nient to use named parentheses instead. For this, PCRE uses (?P>name), which is an extension to the Python syntax that PCRE uses for named parentheses (Perl does not provide named parentheses). We could rewrite the above example as follows: (?P \( ( (?>[^()]+) | (?P>pn) )* \) ) This particular example pattern contains nested unlimited repeats, and so the use of atomic grouping for matching strings of non-parentheses is important when applying the pattern to strings that do not match. For example, when this pattern is applied to (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() it yields "no match" quickly. However, if atomic grouping is not used, the match runs for a very long time indeed because there are so many different ways the + and * repeats can carve up the subject, and all have to be tested before failure can be reported. At the end of a match, the values set for any capturing subpatterns are those from the outermost level of the recursion at which the subpattern value is set. If you want to obtain intermediate values, a callout function can be used (see below and the pcrecallout documentation). If the pattern above is matched against (ab(cd)ef) the value for the capturing parentheses is "ef", which is the last value taken on at the top level. If additional parentheses are added, giving \( ( ( (?>[^()]+) | (?R) )* ) \) ^ ^ ^ ^ the string they capture is "ab(cd)ef", the contents of the top level parentheses. If there are more than 15 capturing parentheses in a pat- tern, PCRE has to obtain extra memory to store data during a recursion, which it does by using pcre_malloc, freeing it via pcre_free after- wards. If no memory can be obtained, the match fails with the PCRE_ERROR_NOMEMORY error. Do not confuse the (?R) item with the condition (R), which tests for recursion. Consider this pattern, which matches text in angle brack- ets, allowing for arbitrary nesting. Only digits are allowed in nested brackets (that is, when recursing), whereas any characters are permit- ted at the outer level. < (?: (?(R) \d++ | [^<>]*+) | (?R)) * > In this pattern, (?(R) is the start of a conditional subpattern, with two different alternatives for the recursive and non-recursive cases. The (?R) item is the actual recursive call. SUBPATTERNS AS SUBROUTINES If the syntax for a recursive subpattern reference (either by number or by name) is used outside the parentheses to which it refers, it oper- ates like a subroutine in a programming language. An earlier example pointed out that the pattern (sens|respons)e and \1ibility matches "sense and sensibility" and "response and responsibility", but not "sense and responsibility". If instead the pattern (sens|respons)e and (?1)ibility is used, it does match "sense and responsibility" as well as the other two strings. Such references must, however, follow the subpattern to which they refer. CALLOUTS Perl has a feature whereby using the sequence (?{...}) causes arbitrary Perl code to be obeyed in the middle of matching a regular expression. This makes it possible, amongst other things, to extract different sub- strings that match the same pair of parentheses when there is a repeti- tion. PCRE provides a similar feature, but of course it cannot obey arbitrary Perl code. The feature is called "callout". The caller of PCRE provides an external function by putting its entry point in the global variable pcre_callout. By default, this variable contains NULL, which disables all calling out. Within a regular expression, (?C) indicates the points at which the external function is to be called. If you want to identify different callout points, you can put a number less than 256 after the letter C. The default value is zero. For example, this pattern has two callout points: (?C1)abc(?C2)def During matching, when PCRE reaches a callout point (and pcre_callout is set), the external function is called. It is provided with the number of the callout, and, optionally, one item of data originally supplied by the caller of pcre_exec(). The callout function may cause matching to backtrack, or to fail altogether. A complete description of the interface to the callout function is given in the pcrecallout documen- tation. Last updated: 03 February 2003 Copyright (c) 1997-2003 University of Cambridge. ----------------------------------------------------------------------------- PCRE(3) PCRE(3) NAME PCRE - Perl-compatible regular expressions PCRE PERFORMANCE Certain items that may appear in regular expression patterns are more efficient than others. It is more efficient to use a character class like [aeiou] than a set of alternatives such as (a|e|i|o|u). In gen- eral, the simplest construction that provides the required behaviour is usually the most efficient. Jeffrey Friedl's book contains a lot of discussion about optimizing regular expressions for efficient perfor- mance. When a pattern begins with .* not in parentheses, or in parentheses that are not the subject of a backreference, and the PCRE_DOTALL option is set, the pattern is implicitly anchored by PCRE, since it can match only at the start of a subject string. However, if PCRE_DOTALL is not set, PCRE cannot make this optimization, because the . metacharacter does not then match a newline, and if the subject string contains new- lines, the pattern may match from the character immediately following one of them instead of from the very start. For example, the pattern .*second matches the subject "first\nand second" (where \n stands for a newline character), with the match starting at the seventh character. In order to do this, PCRE has to retry the match starting after every newline in the subject. If you are using such a pattern with subject strings that do not con- tain newlines, the best performance is obtained by setting PCRE_DOTALL, or starting the pattern with ^.* to indicate explicit anchoring. That saves PCRE from having to scan along the subject looking for a newline to restart at. Beware of patterns that contain nested indefinite repeats. These can take a long time to run when applied to a string that does not match. Consider the pattern fragment (a+)* This can match "aaaa" in 33 different ways, and this number increases very rapidly as the string gets longer. (The * repeat can match 0, 1, 2, 3, or 4 times, and for each of those cases other than 0, the + repeats can match different numbers of times.) When the remainder of the pattern is such that the entire match is going to fail, PCRE has in principle to try every possible variation, and this can take an extremely long time. An optimization catches some of the more simple cases such as (a+)*b where a literal character follows. Before embarking on the standard matching procedure, PCRE checks that there is a "b" later in the sub- ject string, and if there is not, it fails the match immediately. How- ever, when there is no following literal this optimization cannot be used. You can see the difference by comparing the behaviour of (a+)*\d with the pattern above. The former gives a failure almost instantly when applied to a whole line of "a" characters, whereas the latter takes an appreciable time with strings longer than about 20 characters. Last updated: 03 February 2003 Copyright (c) 1997-2003 University of Cambridge. ----------------------------------------------------------------------------- PCRE(3) PCRE(3) NAME PCRE - Perl-compatible regular expressions. SYNOPSIS OF POSIX API #include int regcomp(regex_t *preg, const char *pattern, int cflags); int regexec(regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags); size_t regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size); void regfree(regex_t *preg); DESCRIPTION This set of functions provides a POSIX-style API to the PCRE regular expression package. See the pcreapi documentation for a description of the native API, which contains additional functionality. The functions described here are just wrapper functions that ultimately call the PCRE native API. Their prototypes are defined in the pcreposix.h header file, and on Unix systems the library itself is called pcreposix.a, so can be accessed by adding -lpcreposix to the command for linking an application which uses them. Because the POSIX functions call the native ones, it is also necessary to add -lpcre. I have implemented only those option bits that can be reasonably mapped to PCRE native options. In addition, the options REG_EXTENDED and REG_NOSUB are defined with the value zero. They have no effect, but since programs that are written to the POSIX interface often use them, this makes it easier to slot in PCRE as a replacement library. Other POSIX options are not even defined. When PCRE is called via these functions, it is only the API that is POSIX-like in style. The syntax and semantics of the regular expres- sions themselves are still those of Perl, subject to the setting of various PCRE options, as described below. "POSIX-like in style" means that the API approximates to the POSIX definition; it is not fully POSIX-compatible, and in multi-byte encoding domains it is probably even less compatible. The header for these functions is supplied as pcreposix.h to avoid any potential clash with other POSIX libraries. It can, of course, be renamed or aliased as regex.h, which is the "correct" name. It provides two structure types, regex_t for compiled internal forms, and reg- match_t for returning captured substrings. It also defines some con- stants whose names start with "REG_"; these are used for setting options and identifying error codes. COMPILING A PATTERN The function regcomp() is called to compile a pattern into an internal form. The pattern is a C string terminated by a binary zero, and is passed in the argument pattern. The preg argument is a pointer to a regex_t structure which is used as a base for storing information about the compiled expression. The argument cflags is either zero, or contains one or more of the bits defined by the following macros: REG_ICASE The PCRE_CASELESS option is set when the expression is passed for com- pilation to the native function. REG_NEWLINE The PCRE_MULTILINE option is set when the expression is passed for com- pilation to the native function. Note that this does not mimic the defined POSIX behaviour for REG_NEWLINE (see the following section). In the absence of these flags, no options are passed to the native function. This means the the regex is compiled with PCRE default semantics. In particular, the way it handles newline characters in the subject string is the Perl way, not the POSIX way. Note that setting PCRE_MULTILINE has only some of the effects specified for REG_NEWLINE. It does not affect the way newlines are matched by . (they aren't) or by a negative class such as [^a] (they are). The yield of regcomp() is zero on success, and non-zero otherwise. The preg structure is filled in on success, and one member of the structure is public: re_nsub contains the number of capturing subpatterns in the regular expression. Various error codes are defined in the header file. MATCHING NEWLINE CHARACTERS This area is not simple, because POSIX and Perl take different views of things. It is not possible to get PCRE to obey POSIX semantics, but then PCRE was never intended to be a POSIX engine. The following table lists the different possibilities for matching newline characters in PCRE: Default Change with . matches newline no PCRE_DOTALL newline matches [^a] yes not changeable $ matches \n at end yes PCRE_DOLLARENDONLY $ matches \n in middle no PCRE_MULTILINE ^ matches \n in middle no PCRE_MULTILINE This is the equivalent table for POSIX: Default Change with . matches newline yes REG_NEWLINE newline matches [^a] yes REG_NEWLINE $ matches \n at end no REG_NEWLINE $ matches \n in middle no REG_NEWLINE ^ matches \n in middle no REG_NEWLINE PCRE's behaviour is the same as Perl's, except that there is no equiva- lent for PCRE_DOLLARENDONLY in Perl. In both PCRE and Perl, there is no way to stop newline from matching [^a]. The default POSIX newline handling can be obtained by setting PCRE_DOTALL and PCRE_DOLLARENDONLY, but there is no way to make PCRE behave exactly as for the REG_NEWLINE action. MATCHING A PATTERN The function regexec() is called to match a pre-compiled pattern preg against a given string, which is terminated by a zero byte, subject to the options in eflags. These can be: REG_NOTBOL The PCRE_NOTBOL option is set when calling the underlying PCRE matching function. REG_NOTEOL The PCRE_NOTEOL option is set when calling the underlying PCRE matching function. The portion of the string that was matched, and also any captured sub- strings, are returned via the pmatch argument, which points to an array of nmatch structures of type regmatch_t, containing the members rm_so and rm_eo. These contain the offset to the first character of each sub- string and the offset to the first character after the end of each sub- string, respectively. The 0th element of the vector relates to the entire portion of string that was matched; subsequent elements relate to the capturing subpatterns of the regular expression. Unused entries in the array have both structure members set to -1. A successful match yields a zero return; various error codes are defined in the header file, of which REG_NOMATCH is the "expected" failure code. ERROR MESSAGES The regerror() function maps a non-zero errorcode from either regcomp() or regexec() to a printable message. If preg is not NULL, the error should have arisen from the use of that structure. A message terminated by a binary zero is placed in errbuf. The length of the message, including the zero, is limited to errbuf_size. The yield of the func- tion is the size of buffer needed to hold the whole message. STORAGE Compiling a regular expression causes memory to be allocated and asso- ciated with the preg structure. The function regfree() frees all such memory, after which preg may no longer be used as a compiled expres- sion. AUTHOR Philip Hazel University Computing Service, Cambridge CB2 3QG, England. Last updated: 03 February 2003 Copyright (c) 1997-2003 University of Cambridge. ----------------------------------------------------------------------------- PCRE(3) PCRE(3) NAME PCRE - Perl-compatible regular expressions PCRE SAMPLE PROGRAM A simple, complete demonstration program, to get you started with using PCRE, is supplied in the file pcredemo.c in the PCRE distribution. The program compiles the regular expression that is its first argument, and matches it against the subject string in its second argument. No PCRE options are set, and default character tables are used. If match- ing succeeds, the program outputs the portion of the subject that matched, together with the contents of any captured substrings. If the -g option is given on the command line, the program then goes on to check for further matches of the same regular expression in the same subject string. The logic is a little bit tricky because of the possi- bility of matching an empty string. Comments in the code explain what is going on. On a Unix system that has PCRE installed in /usr/local, you can compile the demonstration program using a command like this: gcc -o pcredemo pcredemo.c -I/usr/local/include \ -L/usr/local/lib -lpcre Then you can run simple tests like this: ./pcredemo 'cat|dog' 'the cat sat on the mat' ./pcredemo -g 'cat|dog' 'the dog sat on the cat' Note that there is a much more comprehensive test program, called pcretest, which supports many more facilities for testing regular expressions and the PCRE library. The pcredemo program is provided as a simple coding example. On some operating systems (e.g. Solaris) you may get an error like this when you try to run pcredemo: ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or directory This is caused by the way shared library support works on those sys- tems. You need to add -R/usr/local/lib to the compile command to get round this problem. Last updated: 28 January 2003 Copyright (c) 1997-2003 University of Cambridge. ----------------------------------------------------------------------------- 07070100014554000081a40000000a0000000a00000001402cbd65000007780000008800000005000000000000000000000022ff350892reloc/doc/pcre/doc/pcre_compile.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B pcre *pcre_compile(const char *\fIpattern\fR, int \fIoptions\fR, .ti +5n .B const char **\fIerrptr\fR, int *\fIerroffset\fR, .ti +5n .B const unsigned char *\fItableptr\fR); .SH DESCRIPTION .rs .sp This function compiles a regular expression into an internal form. Its arguments are: \fIpattern\fR A zero-terminated string containing the regular expression to be compiled \fIoptions\fR Zero or more option bits \fIerrptr\fR Where to put an error message \fIerroffset\fR Offset in pattern where error was found \fItableptr\fR Pointer to character tables, or NULL to use the built-in default The option bits are: PCRE_ANCHORED Force pattern anchoring PCRE_CASELESS Do caseless matching PCRE_DOLLAR_ENDONLY $ not to match newline at end PCRE_DOTALL . matches anything including NL PCRE_EXTENDED Ignore whitespace and # comments PCRE_EXTRA PCRE extra features (not much use currently) PCRE_MULTILINE ^ and $ match newlines within data PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren- theses (named ones available) PCRE_UNGREEDY Invert greediness of quantifiers PCRE_UTF8 Run in UTF-8 mode PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8 validity (only relevant if PCRE_UTF8 is set) PCRE must be compiled with UTF-8 support in order to use PCRE_UTF8 (or PCRE_NO_UTF8_CHECK). The yield of the function is a pointer to a private data structure that contains the compiled pattern, or NULL if an error was detected. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100014555000081a40000000a0000000a00000001402cbd65000004fc0000008800000005000000000000000000000021ff350892reloc/doc/pcre/doc/pcre_config.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_config(int \fIwhat\fR, void *\fIwhere\fR); .SH DESCRIPTION .rs .sp This function makes it possible for a client program to find out which optional features are available in the version of the PCRE library it is using. Its arguments are as follows: \fIwhat\fR A code specifying what information is required \fIwhere\fR Points to where to put the data The available codes are: PCRE_CONFIG_LINK_SIZE Internal link size: 2, 3, or 4 PCRE_CONFIG_MATCH_LIMIT Internal resource limit PCRE_CONFIG_NEWLINE Value of the newline character PCRE_CONFIG_POSIX_MALLOC_THRESHOLD Threshold of return slots, above which \fBmalloc()\fR is used by the POSIX API PCRE_CONFIG_STACKRECURSE Recursion implementation (1=stack 0=heap) PCRE_CONFIG_UTF8 Availability of UTF-8 support (1=yes 0=no) The function yields 0 on success or PCRE_ERROR_BADOPTION otherwise. There is a complete description of the PCRE native API in the .\" HREF \fBpcreapi\fR .\" page, and a description of the POSIX API in the .\" HREF \fBpcreposix\fR .\" page. 07070100014556000081a40000000a0000000a00000001402cbd650000046a000000880000000500000000000000000000002fff350892reloc/doc/pcre/doc/pcre_copy_named_substring.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_copy_named_substring(const pcre *\fIcode\fR, .ti +5n .B const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, const char *\fIstringname\fR, .ti +5n .B char *\fIbuffer\fR, int \fIbuffersize\fR); .SH DESCRIPTION .rs .sp This is a convenience function for extracting a captured substring, identified by name, into a given buffer. The arguments are: \fIcode\fR Pattern that was successfully matched \fIsubject\fR Subject that has been successfully matched \fIovector\fR Offset vector that \fBpcre_exec()\fR used \fIstringcount\fR Value returned by \fBpcre_exec()\fR \fIstringname\fR Name of the required substring \fIbuffer\fR Buffer to receive the string \fIbuffersize\fR Size of buffer The yield is the length of the substring, PCRE_ERROR_NOMEMORY if the buffer was too small, or PCRE_ERROR_NOSUBSTRING if the string name is invalid. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100014557000081a40000000a0000000a00000001402cbd65000003eb0000008800000005000000000000000000000029ff350892reloc/doc/pcre/doc/pcre_copy_substring.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_copy_substring(const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, int \fIstringnumber\fR, char *\fIbuffer\fR, .ti +5n .B int \fIbuffersize\fR); .SH DESCRIPTION .rs .sp This is a convenience function for extracting a captured substring into a given buffer. The arguments are: \fIsubject\fR Subject that has been successfully matched \fIovector\fR Offset vector that \fBpcre_exec()\fR used \fIstringcount\fR Value returned by \fBpcre_exec()\fR \fIstringnumber\fR Number of the required substring \fIbuffer\fR Buffer to receive the string \fIbuffersize\fR Size of buffer The yield is the legnth of the string, PCRE_ERROR_NOMEMORY if the buffer was too small, or PCRE_ERROR_NOSUBSTRING if the string number is invalid. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100014558000081a40000000a0000000a00000001402cbd6500000600000000880000000500000000000000000000001fff350892reloc/doc/pcre/doc/pcre_exec.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_exec(const pcre *\fIcode\fR, "const pcre_extra *\fIextra\fR," .ti +5n .B "const char *\fIsubject\fR," int \fIlength\fR, int \fIstartoffset\fR, .ti +5n .B int \fIoptions\fR, int *\fIovector\fR, int \fIovecsize\fR); .SH DESCRIPTION .rs .sp This function matches a compiled regular expression against a given subject string, and returns offsets to capturing subexpressions. Its arguments are: \fIcode\fR Points to the compiled pattern \fIextra\fR Points to an associated \fBpcre_extra\fR structure, or is NULL \fIsubject\fR Points to the subject string \fIlength\fR Length of the subject string, in bytes \fIstartoffset\fR Offset in bytes in the subject at which to start matching \fIoptions\fR Option bits \fIovector\fR Points to a vector of ints for result offsets \fIovecsize\fR Size of the vector (a multiple of 3) The options are: PCRE_ANCHORED Match only at the first position PCRE_NOTBOL Subject is not the beginning of a line PCRE_NOTEOL Subject is not the end of a line PCRE_NOTEMPTY An empty string is not a valid match PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8 validity (only relevant if PCRE_UTF8 was set at compile time) There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100014559000081a40000000a0000000a00000001402cbd65000001e30000008800000005000000000000000000000029ff350892reloc/doc/pcre/doc/pcre_free_substring.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B void pcre_free_substring(const char *\fIstringptr\fR); .SH DESCRIPTION .rs .sp This is a convenience function for freeing the store obtained by a previous call to \fBpcre_get_substring()\fR or \fBpcre_get_named_substring()\fR. Its only argument is a pointer to the string. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 0707010001455a000081a40000000a0000000a00000001402cbd65000001db000000880000000500000000000000000000002eff350892reloc/doc/pcre/doc/pcre_free_substring_list.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B void pcre_free_substring_list(const char **\fIstringptr\fR); .SH DESCRIPTION .rs .sp This is a convenience function for freeing the store obtained by a previous call to \fBpcre_get_substring_list()\fR. Its only argument is a pointer to the list of string pointers. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 0707010001455b000081a40000000a0000000a00000001402cbd65000006960000008800000005000000000000000000000023ff350892reloc/doc/pcre/doc/pcre_fullinfo.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_fullinfo(const pcre *\fIcode\fR, "const pcre_extra *\fIextra\fR," .ti +5n .B int \fIwhat\fR, void *\fIwhere\fR); .SH DESCRIPTION .rs .sp This function returns information about a compiled pattern. Its arguments are: \fIcode\fR Compiled regular expression \fIextra\fR Result of \fBpcre_study()\fR or NULL \fIwhat\fR What information is required \fIwhere\fR Where to put the information The following information is available: PCRE_INFO_BACKREFMAX Number of highest back reference PCRE_INFO_CAPTURECOUNT Number of capturing subpatterns PCRE_INFO_FIRSTBYTE Fixed first byte for a match, or -1 for start of string or after newline, or -2 otherwise PCRE_INFO_FIRSTTABLE Table of first bytes (after studying) PCRE_INFO_LASTLITERAL Literal last byte required PCRE_INFO_NAMECOUNT Number of named subpatterns PCRE_INFO_NAMEENTRYSIZE Size of name table entry PCRE_INFO_NAMETABLE Pointer to name table PCRE_INFO_OPTIONS Options used for compilation PCRE_INFO_SIZE Size of compiled pattern The yield of the function is zero on success or: PCRE_ERROR_NULL the argument \fIcode\fR was NULL the argument \fIwhere\fR was NULL PCRE_ERROR_BADMAGIC the "magic number" was not found PCRE_ERROR_BADOPTION the value of \fIwhat\fR was invalid There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 0707010001455c000081a40000000a0000000a00000001402cbd650000041e000000880000000500000000000000000000002eff350892reloc/doc/pcre/doc/pcre_get_named_substring.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_get_named_substring(const pcre *\fIcode\fR, .ti +5n .B const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, const char *\fIstringname\fR, .ti +5n .B const char **\fIstringptr\fR); .SH DESCRIPTION .rs .sp This is a convenience function for extracting a captured substring by name. The arguments are: \fIcode\fR Compiled pattern \fIsubject\fR Subject that has been successfully matched \fIovector\fR Offset vector that \fBpcre_exec()\fR used \fIstringcount\fR Value returned by \fBpcre_exec()\fR \fIstringname\fR Name of the required substring \fIstringptr\fR Where to put the string pointer The yield is the length of the extracted substring, PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or PCRE_ERROR_NOSUBSTRING if the string name is invalid. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 0707010001455d000081a40000000a0000000a00000001402cbd6500000292000000880000000500000000000000000000002bff350892reloc/doc/pcre/doc/pcre_get_stringnumber.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_get_stringnumber(const pcre *\fIcode\fR, .ti +5n .B const char *\fIname\fR); .SH DESCRIPTION .rs .sp This convenience function finds the number of a named substring capturing parenthesis in a compiled pattern. Its arguments are: \fIcode\fR Compiled regular expression \fIname\fR Name whose number is required The yield of the function is the number of the parenthesis if the name is found, or PCRE_ERROR_NOSUBSTRING otherwise. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 0707010001455e000081a40000000a0000000a00000001402cbd65000003ba0000008800000005000000000000000000000028ff350892reloc/doc/pcre/doc/pcre_get_substring.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_get_substring(const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, int \fIstringnumber\fR, .ti +5n .B const char **\fIstringptr\fR); .SH DESCRIPTION .rs .sp This is a convenience function for extracting a captured substring. The arguments are: \fIsubject\fR Subject that has been successfully matched \fIovector\fR Offset vector that \fBpcre_exec()\fR used \fIstringcount\fR Value returned by \fBpcre_exec()\fR \fIstringnumber\fR Number of the required substring \fIstringptr\fR Where to put the string pointer The yield is the length of the substring, PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or PCRE_ERROR_NOSUBSTRING if the string number is invalid. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 0707010001455f000081a40000000a0000000a00000001402cbd6500000331000000880000000500000000000000000000002dff350892reloc/doc/pcre/doc/pcre_get_substring_list.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_get_substring_list(const char *\fIsubject\fR, .ti +5n .B int *\fIovector\fR, int \fIstringcount\fR, "const char ***\fIlistptr\fR);" .SH DESCRIPTION .rs .sp This is a convenience function for extracting a list of all the captured substrings. The arguments are: \fIsubject\fR Subject that has been successfully matched \fIovector\fR Offset vector that \fBpcre_exec\fR used \fIstringcount\fR Value returned by \fBpcre_exec\fR \fIlistptr\fR Where to put a pointer to the list The yield is zero on success or PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100014560000081a40000000a0000000a00000001402cbd650000018e000000880000000500000000000000000000001fff350892reloc/doc/pcre/doc/pcre_info.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_info(const pcre *\fIcode\fR, int *\fIoptptr\fR, int .B *\fIfirstcharptr\fR); .SH DESCRIPTION .rs .sp This function is obsolete. You should be using \fBpcre_fullinfo()\fR instead. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100014561000081a40000000a0000000a00000001402cbd65000002520000008800000005000000000000000000000025ff350892reloc/doc/pcre/doc/pcre_maketables.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B const unsigned char *pcre_maketables(void); .SH DESCRIPTION .rs .sp This function builds a set of character tables which can be passed to \fBpcre_compile()\fR to override PCRE's internal, built-in tables (which were made by \fBpcre_maketables()\fR when PCRE was compiled). You might want to do this if you are using a non-standard locale. The function yields a pointer to the tables. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100014562000081a40000000a0000000a00000001402cbd65000003960000008800000005000000000000000000000020ff350892reloc/doc/pcre/doc/pcre_study.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B pcre_extra *pcre_study(const pcre *\fIcode\fR, int \fIoptions\fR, .ti +5n .B const char **\fIerrptr\fR); .SH DESCRIPTION .rs .sp This function studies a compiled pattern, to see if additional information can be extracted that might speed up matching. Its arguments are: \fIcode\fR A compiled regular expression \fIoptions\fR Options for \fBpcre_study()\fR \fIerrptr\fR Where to put an error message If the function returns NULL, either it could not find any additional information, or there was an error. You can tell the difference by looking at the error value. It is NULL in first case. There are currently no options defined; the value of the second argument should always be zero. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100014563000081a40000000a0000000a00000001402cbd65000001790000008800000005000000000000000000000022ff350892reloc/doc/pcre/doc/pcre_version.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B char *pcre_version(void); .SH DESCRIPTION .rs .sp This function returns a character string that gives the version number of the PCRE library, and its date of release. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100014564000081a40000000a0000000a00000001402cbd650000b83a000000880000000500000000000000000000001dff350892reloc/doc/pcre/doc/pcreapi.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS OF PCRE API .rs .sp .B #include .PP .SM .br .B pcre *pcre_compile(const char *\fIpattern\fR, int \fIoptions\fR, .ti +5n .B const char **\fIerrptr\fR, int *\fIerroffset\fR, .ti +5n .B const unsigned char *\fItableptr\fR); .PP .br .B pcre_extra *pcre_study(const pcre *\fIcode\fR, int \fIoptions\fR, .ti +5n .B const char **\fIerrptr\fR); .PP .br .B int pcre_exec(const pcre *\fIcode\fR, "const pcre_extra *\fIextra\fR," .ti +5n .B "const char *\fIsubject\fR," int \fIlength\fR, int \fIstartoffset\fR, .ti +5n .B int \fIoptions\fR, int *\fIovector\fR, int \fIovecsize\fR); .PP .br .B int pcre_copy_named_substring(const pcre *\fIcode\fR, .ti +5n .B const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, const char *\fIstringname\fR, .ti +5n .B char *\fIbuffer\fR, int \fIbuffersize\fR); .PP .br .B int pcre_copy_substring(const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, int \fIstringnumber\fR, char *\fIbuffer\fR, .ti +5n .B int \fIbuffersize\fR); .PP .br .B int pcre_get_named_substring(const pcre *\fIcode\fR, .ti +5n .B const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, const char *\fIstringname\fR, .ti +5n .B const char **\fIstringptr\fR); .PP .br .B int pcre_get_stringnumber(const pcre *\fIcode\fR, .ti +5n .B const char *\fIname\fR); .PP .br .B int pcre_get_substring(const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, int \fIstringnumber\fR, .ti +5n .B const char **\fIstringptr\fR); .PP .br .B int pcre_get_substring_list(const char *\fIsubject\fR, .ti +5n .B int *\fIovector\fR, int \fIstringcount\fR, "const char ***\fIlistptr\fR);" .PP .br .B void pcre_free_substring(const char *\fIstringptr\fR); .PP .br .B void pcre_free_substring_list(const char **\fIstringptr\fR); .PP .br .B const unsigned char *pcre_maketables(void); .PP .br .B int pcre_fullinfo(const pcre *\fIcode\fR, "const pcre_extra *\fIextra\fR," .ti +5n .B int \fIwhat\fR, void *\fIwhere\fR); .PP .br .B int pcre_info(const pcre *\fIcode\fR, int *\fIoptptr\fR, int .B *\fIfirstcharptr\fR); .PP .br .B int pcre_config(int \fIwhat\fR, void *\fIwhere\fR); .PP .br .B char *pcre_version(void); .PP .br .B void *(*pcre_malloc)(size_t); .PP .br .B void (*pcre_free)(void *); .PP .br .B void *(*pcre_stack_malloc)(size_t); .PP .br .B void (*pcre_stack_free)(void *); .PP .br .B int (*pcre_callout)(pcre_callout_block *); .SH PCRE API .rs .sp PCRE has its own native API, which is described in this document. There is also a set of wrapper functions that correspond to the POSIX regular expression API. These are described in the \fBpcreposix\fR documentation. The native API function prototypes are defined in the header file \fBpcre.h\fR, and on Unix systems the library itself is called \fBlibpcre.a\fR, so can be accessed by adding \fB-lpcre\fR to the command for linking an application which calls it. The header file defines the macros PCRE_MAJOR and PCRE_MINOR to contain the major and minor release numbers for the library. Applications can use these to include support for different releases. The functions \fBpcre_compile()\fR, \fBpcre_study()\fR, and \fBpcre_exec()\fR are used for compiling and matching regular expressions. A sample program that demonstrates the simplest way of using them is given in the file \fIpcredemo.c\fR. The \fBpcresample\fR documentation describes how to run it. There are convenience functions for extracting captured substrings from a matched subject string. They are: \fBpcre_copy_substring()\fR \fBpcre_copy_named_substring()\fR \fBpcre_get_substring()\fR \fBpcre_get_named_substring()\fR \fBpcre_get_substring_list()\fR \fBpcre_free_substring()\fR and \fBpcre_free_substring_list()\fR are also provided, to free the memory used for extracted strings. The function \fBpcre_maketables()\fR is used (optionally) to build a set of character tables in the current locale for passing to \fBpcre_compile()\fR. The function \fBpcre_fullinfo()\fR is used to find out information about a compiled pattern; \fBpcre_info()\fR is an obsolete version which returns only some of the available information, but is retained for backwards compatibility. The function \fBpcre_version()\fR returns a pointer to a string containing the version of PCRE and its date of release. The global variables \fBpcre_malloc\fR and \fBpcre_free\fR initially contain the entry points of the standard \fBmalloc()\fR and \fBfree()\fR functions respectively. PCRE calls the memory management functions via these variables, so a calling program can replace them if it wishes to intercept the calls. This should be done before calling any PCRE functions. The global variables \fBpcre_stack_malloc\fR and \fBpcre_stack_free\fR are also indirections to memory management functions. These special functions are used only when PCRE is compiled to use the heap for remembering data, instead of recursive function calls. This is a non-standard way of building PCRE, for use in environments that have limited stacks. Because of the greater use of memory management, it runs more slowly. Separate functions are provided so that special-purpose external code can be used for this case. When used, these functions are always called in a stack-like manner (last obtained, first freed), and always for memory blocks of the same size. The global variable \fBpcre_callout\fR initially contains NULL. It can be set by the caller to a "callout" function, which PCRE will then call at specified points during a matching operation. Details are given in the \fBpcrecallout\fR documentation. .SH MULTITHREADING .rs .sp The PCRE functions can be used in multi-threading applications, with the proviso that the memory management functions pointed to by \fBpcre_malloc\fR, \fBpcre_free\fR, \fBpcre_stack_malloc\fR, and \fBpcre_stack_free\fR, and the callout function pointed to by \fBpcre_callout\fR, are shared by all threads. The compiled form of a regular expression is not altered during matching, so the same compiled pattern can safely be used by several threads at once. .SH CHECKING BUILD-TIME OPTIONS .rs .sp .B int pcre_config(int \fIwhat\fR, void *\fIwhere\fR); .PP The function \fBpcre_config()\fR makes it possible for a PCRE client to discover which optional features have been compiled into the PCRE library. The .\" HREF \fBpcrebuild\fR .\" documentation has more details about these optional features. The first argument for \fBpcre_config()\fR is an integer, specifying which information is required; the second argument is a pointer to a variable into which the information is placed. The following information is available: PCRE_CONFIG_UTF8 The output is an integer that is set to one if UTF-8 support is available; otherwise it is set to zero. PCRE_CONFIG_NEWLINE The output is an integer that is set to the value of the code that is used for the newline character. It is either linefeed (10) or carriage return (13), and should normally be the standard character for your operating system. PCRE_CONFIG_LINK_SIZE The output is an integer that contains the number of bytes used for internal linkage in compiled regular expressions. The value is 2, 3, or 4. Larger values allow larger regular expressions to be compiled, at the expense of slower matching. The default value of 2 is sufficient for all but the most massive patterns, since it allows the compiled pattern to be up to 64K in size. PCRE_CONFIG_POSIX_MALLOC_THRESHOLD The output is an integer that contains the threshold above which the POSIX interface uses \fBmalloc()\fR for output vectors. Further details are given in the \fBpcreposix\fR documentation. PCRE_CONFIG_MATCH_LIMIT The output is an integer that gives the default limit for the number of internal matching function calls in a \fBpcre_exec()\fR execution. Further details are given with \fBpcre_exec()\fR below. PCRE_CONFIG_STACKRECURSE The output is an integer that is set to one if internal recursion is implemented by recursive function calls that use the stack to remember their state. This is the usual way that PCRE is compiled. The output is zero if PCRE was compiled to use blocks of data on the heap instead of recursive function calls. In this case, \fBpcre_stack_malloc\fR and \fBpcre_stack_free\fR are called to manage memory blocks on the heap, thus avoiding the use of the stack. .SH COMPILING A PATTERN .rs .sp .B pcre *pcre_compile(const char *\fIpattern\fR, int \fIoptions\fR, .ti +5n .B const char **\fIerrptr\fR, int *\fIerroffset\fR, .ti +5n .B const unsigned char *\fItableptr\fR); .PP The function \fBpcre_compile()\fR is called to compile a pattern into an internal form. The pattern is a C string terminated by a binary zero, and is passed in the argument \fIpattern\fR. A pointer to a single block of memory that is obtained via \fBpcre_malloc\fR is returned. This contains the compiled code and related data. The \fBpcre\fR type is defined for the returned block; this is a typedef for a structure whose contents are not externally defined. It is up to the caller to free the memory when it is no longer required. Although the compiled code of a PCRE regex is relocatable, that is, it does not depend on memory location, the complete \fBpcre\fR data block is not fully relocatable, because it contains a copy of the \fItableptr\fR argument, which is an address (see below). The \fIoptions\fR argument contains independent bits that affect the compilation. It should be zero if no options are required. Some of the options, in particular, those that are compatible with Perl, can also be set and unset from within the pattern (see the detailed description of regular expressions in the \fBpcrepattern\fR documentation). For these options, the contents of the \fIoptions\fR argument specifies their initial settings at the start of compilation and execution. The PCRE_ANCHORED option can be set at the time of matching as well as at compile time. If \fIerrptr\fR is NULL, \fBpcre_compile()\fR returns NULL immediately. Otherwise, if compilation of a pattern fails, \fBpcre_compile()\fR returns NULL, and sets the variable pointed to by \fIerrptr\fR to point to a textual error message. The offset from the start of the pattern to the character where the error was discovered is placed in the variable pointed to by \fIerroffset\fR, which must not be NULL. If it is, an immediate error is given. If the final argument, \fItableptr\fR, is NULL, PCRE uses a default set of character tables which are built when it is compiled, using the default C locale. Otherwise, \fItableptr\fR must be the result of a call to \fBpcre_maketables()\fR. See the section on locale support below. This code fragment shows a typical straightforward call to \fBpcre_compile()\fR: pcre *re; const char *error; int erroffset; re = pcre_compile( "^A.*Z", /* the pattern */ 0, /* default options */ &error, /* for error message */ &erroffset, /* for error offset */ NULL); /* use default character tables */ The following option bits are defined: PCRE_ANCHORED If this bit is set, the pattern is forced to be "anchored", that is, it is constrained to match only at the first matching point in the string which is being searched (the "subject string"). This effect can also be achieved by appropriate constructs in the pattern itself, which is the only way to do it in Perl. PCRE_CASELESS If this bit is set, letters in the pattern match both upper and lower case letters. It is equivalent to Perl's /i option, and it can be changed within a pattern by a (?i) option setting. PCRE_DOLLAR_ENDONLY If this bit is set, a dollar metacharacter in the pattern matches only at the end of the subject string. Without this option, a dollar also matches immediately before the final character if it is a newline (but not before any other newlines). The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is set. There is no equivalent to this option in Perl, and no way to set it within a pattern. PCRE_DOTALL If this bit is set, a dot metacharater in the pattern matches all characters, including newlines. Without it, newlines are excluded. This option is equivalent to Perl's /s option, and it can be changed within a pattern by a (?s) option setting. A negative class such as [^a] always matches a newline character, independent of the setting of this option. PCRE_EXTENDED If this bit is set, whitespace data characters in the pattern are totally ignored except when escaped or inside a character class. Whitespace does not include the VT character (code 11). In addition, characters between an unescaped # outside a character class and the next newline character, inclusive, are also ignored. This is equivalent to Perl's /x option, and it can be changed within a pattern by a (?x) option setting. This option makes it possible to include comments inside complicated patterns. Note, however, that this applies only to data characters. Whitespace characters may never appear within special character sequences in a pattern, for example within the sequence (?( which introduces a conditional subpattern. PCRE_EXTRA This option was invented in order to turn on additional functionality of PCRE that is incompatible with Perl, but it is currently of very little use. When set, any backslash in a pattern that is followed by a letter that has no special meaning causes an error, thus reserving these combinations for future expansion. By default, as in Perl, a backslash followed by a letter with no special meaning is treated as a literal. There are at present no other features controlled by this option. It can also be set by a (?X) option setting within a pattern. PCRE_MULTILINE By default, PCRE treats the subject string as consisting of a single "line" of characters (even if it actually contains several newlines). The "start of line" metacharacter (^) matches only at the start of the string, while the "end of line" metacharacter ($) matches only at the end of the string, or before a terminating newline (unless PCRE_DOLLAR_ENDONLY is set). This is the same as Perl. When PCRE_MULTILINE it is set, the "start of line" and "end of line" constructs match immediately following or immediately before any newline in the subject string, respectively, as well as at the very start and end. This is equivalent to Perl's /m option, and it can be changed within a pattern by a (?m) option setting. If there are no "\\n" characters in a subject string, or no occurrences of ^ or $ in a pattern, setting PCRE_MULTILINE has no effect. PCRE_NO_AUTO_CAPTURE If this option is set, it disables the use of numbered capturing parentheses in the pattern. Any opening parenthesis that is not followed by ? behaves as if it were followed by ?: but named parentheses can still be used for capturing (and they acquire numbers in the usual way). There is no equivalent of this option in Perl. PCRE_UNGREEDY This option inverts the "greediness" of the quantifiers so that they are not greedy by default, but become greedy if followed by "?". It is not compatible with Perl. It can also be set by a (?U) option setting within the pattern. PCRE_UTF8 This option causes PCRE to regard both the pattern and the subject as strings of UTF-8 characters instead of single-byte character strings. However, it is available only if PCRE has been built to include UTF-8 support. If not, the use of this option provokes an error. Details of how this option changes the behaviour of PCRE are given in the .\" HTML .\" section on UTF-8 support .\" in the main .\" HREF \fBpcre\fR .\" page. PCRE_NO_UTF8_CHECK When PCRE_UTF8 is set, the validity of the pattern as a UTF-8 string is automatically checked. If an invalid UTF-8 sequence of bytes is found, \fBpcre_compile()\fR returns an error. If you already know that your pattern is valid, and you want to skip this check for performance reasons, you can set the PCRE_NO_UTF8_CHECK option. When it is set, the effect of passing an invalid UTF-8 string as a pattern is undefined. It may cause your program to crash. Note that there is a similar option for suppressing the checking of subject strings passed to \fBpcre_exec()\fR. .SH STUDYING A PATTERN .rs .sp .B pcre_extra *pcre_study(const pcre *\fIcode\fR, int \fIoptions\fR, .ti +5n .B const char **\fIerrptr\fR); .PP When a pattern is going to be used several times, it is worth spending more time analyzing it in order to speed up the time taken for matching. The function \fBpcre_study()\fR takes a pointer to a compiled pattern as its first argument. If studing the pattern produces additional information that will help speed up matching, \fBpcre_study()\fR returns a pointer to a \fBpcre_extra\fR block, in which the \fIstudy_data\fR field points to the results of the study. The returned value from a \fBpcre_study()\fR can be passed directly to \fBpcre_exec()\fR. However, the \fBpcre_extra\fR block also contains other fields that can be set by the caller before the block is passed; these are described below. If studying the pattern does not produce any additional information, \fBpcre_study()\fR returns NULL. In that circumstance, if the calling program wants to pass some of the other fields to \fBpcre_exec()\fR, it must set up its own \fBpcre_extra\fR block. The second argument contains option bits. At present, no options are defined for \fBpcre_study()\fR, and this argument should always be zero. The third argument for \fBpcre_study()\fR is a pointer for an error message. If studying succeeds (even if no data is returned), the variable it points to is set to NULL. Otherwise it points to a textual error message. You should therefore test the error pointer for NULL after calling \fBpcre_study()\fR, to be sure that it has run successfully. This is a typical call to \fBpcre_study\fR(): pcre_extra *pe; pe = pcre_study( re, /* result of pcre_compile() */ 0, /* no options exist */ &error); /* set to NULL or points to a message */ At present, studying a pattern is useful only for non-anchored patterns that do not have a single fixed starting character. A bitmap of possible starting characters is created. .\" HTML .SH LOCALE SUPPORT .rs .sp PCRE handles caseless matching, and determines whether characters are letters, digits, or whatever, by reference to a set of tables. When running in UTF-8 mode, this applies only to characters with codes less than 256. The library contains a default set of tables that is created in the default C locale when PCRE is compiled. This is used when the final argument of \fBpcre_compile()\fR is NULL, and is sufficient for many applications. An alternative set of tables can, however, be supplied. Such tables are built by calling the \fBpcre_maketables()\fR function, which has no arguments, in the relevant locale. The result can then be passed to \fBpcre_compile()\fR as often as necessary. For example, to build and use tables that are appropriate for the French locale (where accented characters with codes greater than 128 are treated as letters), the following code could be used: setlocale(LC_CTYPE, "fr"); tables = pcre_maketables(); re = pcre_compile(..., tables); The tables are built in memory that is obtained via \fBpcre_malloc\fR. The pointer that is passed to \fBpcre_compile\fR is saved with the compiled pattern, and the same tables are used via this pointer by \fBpcre_study()\fR and \fBpcre_exec()\fR. Thus, for any single pattern, compilation, studying and matching all happen in the same locale, but different patterns can be compiled in different locales. It is the caller's responsibility to ensure that the memory containing the tables remains available for as long as it is needed. .SH INFORMATION ABOUT A PATTERN .rs .sp .B int pcre_fullinfo(const pcre *\fIcode\fR, "const pcre_extra *\fIextra\fR," .ti +5n .B int \fIwhat\fR, void *\fIwhere\fR); .PP The \fBpcre_fullinfo()\fR function returns information about a compiled pattern. It replaces the obsolete \fBpcre_info()\fR function, which is nevertheless retained for backwards compability (and is documented below). The first argument for \fBpcre_fullinfo()\fR is a pointer to the compiled pattern. The second argument is the result of \fBpcre_study()\fR, or NULL if the pattern was not studied. The third argument specifies which piece of information is required, and the fourth argument is a pointer to a variable to receive the data. The yield of the function is zero for success, or one of the following negative numbers: PCRE_ERROR_NULL the argument \fIcode\fR was NULL the argument \fIwhere\fR was NULL PCRE_ERROR_BADMAGIC the "magic number" was not found PCRE_ERROR_BADOPTION the value of \fIwhat\fR was invalid Here is a typical call of \fBpcre_fullinfo()\fR, to obtain the length of the compiled pattern: int rc; unsigned long int length; rc = pcre_fullinfo( re, /* result of pcre_compile() */ pe, /* result of pcre_study(), or NULL */ PCRE_INFO_SIZE, /* what is required */ &length); /* where to put the data */ The possible values for the third argument are defined in \fBpcre.h\fR, and are as follows: PCRE_INFO_BACKREFMAX Return the number of the highest back reference in the pattern. The fourth argument should point to an \fBint\fR variable. Zero is returned if there are no back references. PCRE_INFO_CAPTURECOUNT Return the number of capturing subpatterns in the pattern. The fourth argument should point to an \fbint\fR variable. PCRE_INFO_FIRSTBYTE Return information about the first byte of any matched string, for a non-anchored pattern. (This option used to be called PCRE_INFO_FIRSTCHAR; the old name is still recognized for backwards compatibility.) If there is a fixed first byte, e.g. from a pattern such as (cat|cow|coyote), it is returned in the integer pointed to by \fIwhere\fR. Otherwise, if either (a) the pattern was compiled with the PCRE_MULTILINE option, and every branch starts with "^", or (b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set (if it were set, the pattern would be anchored), -1 is returned, indicating that the pattern matches only at the start of a subject string or after any newline within the string. Otherwise -2 is returned. For anchored patterns, -2 is returned. PCRE_INFO_FIRSTTABLE If the pattern was studied, and this resulted in the construction of a 256-bit table indicating a fixed set of bytes for the first byte in any matching string, a pointer to the table is returned. Otherwise NULL is returned. The fourth argument should point to an \fBunsigned char *\fR variable. PCRE_INFO_LASTLITERAL Return the value of the rightmost literal byte that must exist in any matched string, other than at its start, if such a byte has been recorded. The fourth argument should point to an \fBint\fR variable. If there is no such byte, -1 is returned. For anchored patterns, a last literal byte is recorded only if it follows something of variable length. For example, for the pattern /^a\\d+z\\d+/ the returned value is "z", but for /^a\\dz\\d/ the returned value is -1. PCRE_INFO_NAMECOUNT PCRE_INFO_NAMEENTRYSIZE PCRE_INFO_NAMETABLE PCRE supports the use of named as well as numbered capturing parentheses. The names are just an additional way of identifying the parentheses, which still acquire a number. A caller that wants to extract data from a named subpattern must convert the name to a number in order to access the correct pointers in the output vector (described with \fBpcre_exec()\fR below). In order to do this, it must first use these three values to obtain the name-to-number mapping table for the pattern. The map consists of a number of fixed-size entries. PCRE_INFO_NAMECOUNT gives the number of entries, and PCRE_INFO_NAMEENTRYSIZE gives the size of each entry; both of these return an \fBint\fR value. The entry size depends on the length of the longest name. PCRE_INFO_NAMETABLE returns a pointer to the first entry of the table (a pointer to \fBchar\fR). The first two bytes of each entry are the number of the capturing parenthesis, most significant byte first. The rest of the entry is the corresponding name, zero terminated. The names are in alphabetical order. For example, consider the following pattern (assume PCRE_EXTENDED is set, so white space - including newlines - is ignored): (?P (?P(\\d\\d)?\\d\\d) - (?P\\d\\d) - (?P\\d\\d) ) There are four named subpatterns, so the table has four entries, and each entry in the table is eight bytes long. The table is as follows, with non-printing bytes shows in hex, and undefined bytes shown as ??: 00 01 d a t e 00 ?? 00 05 d a y 00 ?? ?? 00 04 m o n t h 00 00 02 y e a r 00 ?? When writing code to extract data from named subpatterns, remember that the length of each entry may be different for each compiled pattern. PCRE_INFO_OPTIONS Return a copy of the options with which the pattern was compiled. The fourth argument should point to an \fBunsigned long int\fR variable. These option bits are those specified in the call to \fBpcre_compile()\fR, modified by any top-level option settings within the pattern itself. A pattern is automatically anchored by PCRE if all of its top-level alternatives begin with one of the following: ^ unless PCRE_MULTILINE is set \\A always \\G always .* if PCRE_DOTALL is set and there are no back references to the subpattern in which .* appears For such patterns, the PCRE_ANCHORED bit is set in the options returned by \fBpcre_fullinfo()\fR. PCRE_INFO_SIZE Return the size of the compiled pattern, that is, the value that was passed as the argument to \fBpcre_malloc()\fR when PCRE was getting memory in which to place the compiled data. The fourth argument should point to a \fBsize_t\fR variable. PCRE_INFO_STUDYSIZE Returns the size of the data block pointed to by the \fIstudy_data\fR field in a \fBpcre_extra\fR block. That is, it is the value that was passed to \fBpcre_malloc()\fR when PCRE was getting memory into which to place the data created by \fBpcre_study()\fR. The fourth argument should point to a \fBsize_t\fR variable. .SH OBSOLETE INFO FUNCTION .rs .sp .B int pcre_info(const pcre *\fIcode\fR, int *\fIoptptr\fR, int .B *\fIfirstcharptr\fR); .PP The \fBpcre_info()\fR function is now obsolete because its interface is too restrictive to return all the available data about a compiled pattern. New programs should use \fBpcre_fullinfo()\fR instead. The yield of \fBpcre_info()\fR is the number of capturing subpatterns, or one of the following negative numbers: PCRE_ERROR_NULL the argument \fIcode\fR was NULL PCRE_ERROR_BADMAGIC the "magic number" was not found If the \fIoptptr\fR argument is not NULL, a copy of the options with which the pattern was compiled is placed in the integer it points to (see PCRE_INFO_OPTIONS above). If the pattern is not anchored and the \fIfirstcharptr\fR argument is not NULL, it is used to pass back information about the first character of any matched string (see PCRE_INFO_FIRSTBYTE above). .SH MATCHING A PATTERN .rs .sp .B int pcre_exec(const pcre *\fIcode\fR, "const pcre_extra *\fIextra\fR," .ti +5n .B "const char *\fIsubject\fR," int \fIlength\fR, int \fIstartoffset\fR, .ti +5n .B int \fIoptions\fR, int *\fIovector\fR, int \fIovecsize\fR); .PP The function \fBpcre_exec()\fR is called to match a subject string against a pre-compiled pattern, which is passed in the \fIcode\fR argument. If the pattern has been studied, the result of the study should be passed in the \fIextra\fR argument. Here is an example of a simple call to \fBpcre_exec()\fR: int rc; int ovector[30]; rc = pcre_exec( re, /* result of pcre_compile() */ NULL, /* we didn't study the pattern */ "some string", /* the subject string */ 11, /* the length of the subject string */ 0, /* start at offset 0 in the subject */ 0, /* default options */ ovector, /* vector for substring information */ 30); /* number of elements in the vector */ If the \fIextra\fR argument is not NULL, it must point to a \fBpcre_extra\fR data block. The \fBpcre_study()\fR function returns such a block (when it doesn't return NULL), but you can also create one for yourself, and pass additional information in it. The fields in the block are as follows: unsigned long int \fIflags\fR; void *\fIstudy_data\fR; unsigned long int \fImatch_limit\fR; void *\fIcallout_data\fR; The \fIflags\fR field is a bitmap that specifies which of the other fields are set. The flag bits are: PCRE_EXTRA_STUDY_DATA PCRE_EXTRA_MATCH_LIMIT PCRE_EXTRA_CALLOUT_DATA Other flag bits should be set to zero. The \fIstudy_data\fR field is set in the \fBpcre_extra\fR block that is returned by \fBpcre_study()\fR, together with the appropriate flag bit. You should not set this yourself, but you can add to the block by setting the other fields. The \fImatch_limit\fR field provides a means of preventing PCRE from using up a vast amount of resources when running patterns that are not going to match, but which have a very large number of possibilities in their search trees. The classic example is the use of nested unlimited repeats. Internally, PCRE uses a function called \fBmatch()\fR which it calls repeatedly (sometimes recursively). The limit is imposed on the number of times this function is called during a match, which has the effect of limiting the amount of recursion and backtracking that can take place. For patterns that are not anchored, the count starts from zero for each position in the subject string. The default limit for the library can be set when PCRE is built; the default default is 10 million, which handles all but the most extreme cases. You can reduce the default by suppling \fBpcre_exec()\fR with a \fRpcre_extra\fR block in which \fImatch_limit\fR is set to a smaller value, and PCRE_EXTRA_MATCH_LIMIT is set in the \fIflags\fR field. If the limit is exceeded, \fBpcre_exec()\fR returns PCRE_ERROR_MATCHLIMIT. The \fIpcre_callout\fR field is used in conjunction with the "callout" feature, which is described in the \fBpcrecallout\fR documentation. The PCRE_ANCHORED option can be passed in the \fIoptions\fR argument, whose unused bits must be zero. This limits \fBpcre_exec()\fR to matching at the first matching position. However, if a pattern was compiled with PCRE_ANCHORED, or turned out to be anchored by virtue of its contents, it cannot be made unachored at matching time. When PCRE_UTF8 was set at compile time, the validity of the subject as a UTF-8 string is automatically checked, and the value of \fIstartoffset\fR is also checked to ensure that it points to the start of a UTF-8 character. If an invalid UTF-8 sequence of bytes is found, \fBpcre_exec()\fR returns the error PCRE_ERROR_BADUTF8. If \fIstartoffset\fR contains an invalid value, PCRE_ERROR_BADUTF8_OFFSET is returned. If you already know that your subject is valid, and you want to skip these checks for performance reasons, you can set the PCRE_NO_UTF8_CHECK option when calling \fBpcre_exec()\fR. You might want to do this for the second and subsequent calls to \fBpcre_exec()\fR if you are making repeated calls to find all the matches in a single subject string. However, you should be sure that the value of \fIstartoffset\fR points to the start of a UTF-8 character. When PCRE_NO_UTF8_CHECK is set, the effect of passing an invalid UTF-8 string as a subject, or a value of \fIstartoffset\fR that does not point to the start of a UTF-8 character, is undefined. Your program may crash. There are also three further options that can be set only at matching time: PCRE_NOTBOL The first character of the string is not the beginning of a line, so the circumflex metacharacter should not match before it. Setting this without PCRE_MULTILINE (at compile time) causes circumflex never to match. PCRE_NOTEOL The end of the string is not the end of a line, so the dollar metacharacter should not match it nor (except in multiline mode) a newline immediately before it. Setting this without PCRE_MULTILINE (at compile time) causes dollar never to match. PCRE_NOTEMPTY An empty string is not considered to be a valid match if this option is set. If there are alternatives in the pattern, they are tried. If all the alternatives match the empty string, the entire match fails. For example, if the pattern a?b? is applied to a string not beginning with "a" or "b", it matches the empty string at the start of the subject. With PCRE_NOTEMPTY set, this match is not valid, so PCRE searches further into the string for occurrences of "a" or "b". Perl has no direct equivalent of PCRE_NOTEMPTY, but it does make a special case of a pattern match of the empty string within its \fBsplit()\fR function, and when using the /g modifier. It is possible to emulate Perl's behaviour after matching a null string by first trying the match again at the same offset with PCRE_NOTEMPTY set, and then if that fails by advancing the starting offset (see below) and trying an ordinary match again. The subject string is passed to \fBpcre_exec()\fR as a pointer in \fIsubject\fR, a length in \fIlength\fR, and a starting byte offset in \fIstartoffset\fR. Unlike the pattern string, the subject may contain binary zero bytes. When the starting offset is zero, the search for a match starts at the beginning of the subject, and this is by far the most common case. If the pattern was compiled with the PCRE_UTF8 option, the subject must be a sequence of bytes that is a valid UTF-8 string, and the starting offset must point to the beginning of a UTF-8 character. If an invalid UTF-8 string or offset is passed, an error (either PCRE_ERROR_BADUTF8 or PCRE_ERROR_BADUTF8_OFFSET) is returned, unless the option PCRE_NO_UTF8_CHECK is set, in which case PCRE's behaviour is not defined. A non-zero starting offset is useful when searching for another match in the same subject by calling \fBpcre_exec()\fR again after a previous success. Setting \fIstartoffset\fR differs from just passing over a shortened string and setting PCRE_NOTBOL in the case of a pattern that begins with any kind of lookbehind. For example, consider the pattern \\Biss\\B which finds occurrences of "iss" in the middle of words. (\\B matches only if the current position in the subject is not a word boundary.) When applied to the string "Mississipi" the first call to \fBpcre_exec()\fR finds the first occurrence. If \fBpcre_exec()\fR is called again with just the remainder of the subject, namely "issipi", it does not match, because \\B is always false at the start of the subject, which is deemed to be a word boundary. However, if \fBpcre_exec()\fR is passed the entire string again, but with \fIstartoffset\fR set to 4, it finds the second occurrence of "iss" because it is able to look behind the starting point to discover that it is preceded by a letter. If a non-zero starting offset is passed when the pattern is anchored, one attempt to match at the given offset is tried. This can only succeed if the pattern does not require the match to be at the start of the subject. In general, a pattern matches a certain portion of the subject, and in addition, further substrings from the subject may be picked out by parts of the pattern. Following the usage in Jeffrey Friedl's book, this is called "capturing" in what follows, and the phrase "capturing subpattern" is used for a fragment of a pattern that picks out a substring. PCRE supports several other kinds of parenthesized subpattern that do not cause substrings to be captured. Captured substrings are returned to the caller via a vector of integer offsets whose address is passed in \fIovector\fR. The number of elements in the vector is passed in \fIovecsize\fR. The first two-thirds of the vector is used to pass back captured substrings, each substring using a pair of integers. The remaining third of the vector is used as workspace by \fBpcre_exec()\fR while matching capturing subpatterns, and is not available for passing back information. The length passed in \fIovecsize\fR should always be a multiple of three. If it is not, it is rounded down. When a match has been successful, information about captured substrings is returned in pairs of integers, starting at the beginning of \fIovector\fR, and continuing up to two-thirds of its length at the most. The first element of a pair is set to the offset of the first character in a substring, and the second is set to the offset of the first character after the end of a substring. The first pair, \fIovector[0]\fR and \fIovector[1]\fR, identify the portion of the subject string matched by the entire pattern. The next pair is used for the first capturing subpattern, and so on. The value returned by \fBpcre_exec()\fR is the number of pairs that have been set. If there are no capturing subpatterns, the return value from a successful match is 1, indicating that just the first pair of offsets has been set. Some convenience functions are provided for extracting the captured substrings as separate strings. These are described in the following section. It is possible for an capturing subpattern number \fIn+1\fR to match some part of the subject when subpattern \fIn\fR has not been used at all. For example, if the string "abc" is matched against the pattern (a|(z))(bc) subpatterns 1 and 3 are matched, but 2 is not. When this happens, both offset values corresponding to the unused subpattern are set to -1. If a capturing subpattern is matched repeatedly, it is the last portion of the string that it matched that gets returned. If the vector is too small to hold all the captured substrings, it is used as far as possible (up to two-thirds of its length), and the function returns a value of zero. In particular, if the substring offsets are not of interest, \fBpcre_exec()\fR may be called with \fIovector\fR passed as NULL and \fIovecsize\fR as zero. However, if the pattern contains back references and the \fIovector\fR isn't big enough to remember the related substrings, PCRE has to get additional memory for use during matching. Thus it is usually advisable to supply an \fIovector\fR. Note that \fBpcre_info()\fR can be used to find out how many capturing subpatterns there are in a compiled pattern. The smallest size for \fIovector\fR that will allow for \fIn\fR captured substrings, in addition to the offsets of the substring matched by the whole pattern, is (\fIn\fR+1)*3. If \fBpcre_exec()\fR fails, it returns a negative number. The following are defined in the header file: PCRE_ERROR_NOMATCH (-1) The subject string did not match the pattern. PCRE_ERROR_NULL (-2) Either \fIcode\fR or \fIsubject\fR was passed as NULL, or \fIovector\fR was NULL and \fIovecsize\fR was not zero. PCRE_ERROR_BADOPTION (-3) An unrecognized bit was set in the \fIoptions\fR argument. PCRE_ERROR_BADMAGIC (-4) PCRE stores a 4-byte "magic number" at the start of the compiled code, to catch the case when it is passed a junk pointer. This is the error it gives when the magic number isn't present. PCRE_ERROR_UNKNOWN_NODE (-5) While running the pattern match, an unknown item was encountered in the compiled pattern. This error could be caused by a bug in PCRE or by overwriting of the compiled pattern. PCRE_ERROR_NOMEMORY (-6) If a pattern contains back references, but the \fIovector\fR that is passed to \fBpcre_exec()\fR is not big enough to remember the referenced substrings, PCRE gets a block of memory at the start of matching to use for this purpose. If the call via \fBpcre_malloc()\fR fails, this error is given. The memory is freed at the end of matching. PCRE_ERROR_NOSUBSTRING (-7) This error is used by the \fBpcre_copy_substring()\fR, \fBpcre_get_substring()\fR, and \fBpcre_get_substring_list()\fR functions (see below). It is never returned by \fBpcre_exec()\fR. PCRE_ERROR_MATCHLIMIT (-8) The recursion and backtracking limit, as specified by the \fImatch_limit\fR field in a \fBpcre_extra\fR structure (or defaulted) was reached. See the description above. PCRE_ERROR_CALLOUT (-9) This error is never generated by \fBpcre_exec()\fR itself. It is provided for use by callout functions that want to yield a distinctive error code. See the \fBpcrecallout\fR documentation for details. PCRE_ERROR_BADUTF8 (-10) A string that contains an invalid UTF-8 byte sequence was passed as a subject. PCRE_ERROR_BADUTF8_OFFSET (-11) The UTF-8 byte sequence that was passed as a subject was valid, but the value of \fIstartoffset\fR did not point to the beginning of a UTF-8 character. .SH EXTRACTING CAPTURED SUBSTRINGS BY NUMBER .rs .sp .B int pcre_copy_substring(const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, int \fIstringnumber\fR, char *\fIbuffer\fR, .ti +5n .B int \fIbuffersize\fR); .PP .br .B int pcre_get_substring(const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, int \fIstringnumber\fR, .ti +5n .B const char **\fIstringptr\fR); .PP .br .B int pcre_get_substring_list(const char *\fIsubject\fR, .ti +5n .B int *\fIovector\fR, int \fIstringcount\fR, "const char ***\fIlistptr\fR);" .PP Captured substrings can be accessed directly by using the offsets returned by \fBpcre_exec()\fR in \fIovector\fR. For convenience, the functions \fBpcre_copy_substring()\fR, \fBpcre_get_substring()\fR, and \fBpcre_get_substring_list()\fR are provided for extracting captured substrings as new, separate, zero-terminated strings. These functions identify substrings by number. The next section describes functions for extracting named substrings. A substring that contains a binary zero is correctly extracted and has a further zero added on the end, but the result is not, of course, a C string. The first three arguments are the same for all three of these functions: \fIsubject\fR is the subject string which has just been successfully matched, \fIovector\fR is a pointer to the vector of integer offsets that was passed to \fBpcre_exec()\fR, and \fIstringcount\fR is the number of substrings that were captured by the match, including the substring that matched the entire regular expression. This is the value returned by \fBpcre_exec\fR if it is greater than zero. If \fBpcre_exec()\fR returned zero, indicating that it ran out of space in \fIovector\fR, the value passed as \fIstringcount\fR should be the size of the vector divided by three. The functions \fBpcre_copy_substring()\fR and \fBpcre_get_substring()\fR extract a single substring, whose number is given as \fIstringnumber\fR. A value of zero extracts the substring that matched the entire pattern, while higher values extract the captured substrings. For \fBpcre_copy_substring()\fR, the string is placed in \fIbuffer\fR, whose length is given by \fIbuffersize\fR, while for \fBpcre_get_substring()\fR a new block of memory is obtained via \fBpcre_malloc\fR, and its address is returned via \fIstringptr\fR. The yield of the function is the length of the string, not including the terminating zero, or one of PCRE_ERROR_NOMEMORY (-6) The buffer was too small for \fBpcre_copy_substring()\fR, or the attempt to get memory failed for \fBpcre_get_substring()\fR. PCRE_ERROR_NOSUBSTRING (-7) There is no substring whose number is \fIstringnumber\fR. The \fBpcre_get_substring_list()\fR function extracts all available substrings and builds a list of pointers to them. All this is done in a single block of memory which is obtained via \fBpcre_malloc\fR. The address of the memory block is returned via \fIlistptr\fR, which is also the start of the list of string pointers. The end of the list is marked by a NULL pointer. The yield of the function is zero if all went well, or PCRE_ERROR_NOMEMORY (-6) if the attempt to get the memory block failed. When any of these functions encounter a substring that is unset, which can happen when capturing subpattern number \fIn+1\fR matches some part of the subject, but subpattern \fIn\fR has not been used at all, they return an empty string. This can be distinguished from a genuine zero-length substring by inspecting the appropriate offset in \fIovector\fR, which is negative for unset substrings. The two convenience functions \fBpcre_free_substring()\fR and \fBpcre_free_substring_list()\fR can be used to free the memory returned by a previous call of \fBpcre_get_substring()\fR or \fBpcre_get_substring_list()\fR, respectively. They do nothing more than call the function pointed to by \fBpcre_free\fR, which of course could be called directly from a C program. However, PCRE is used in some situations where it is linked via a special interface to another programming language which cannot use \fBpcre_free\fR directly; it is for these cases that the functions are provided. .SH EXTRACTING CAPTURED SUBSTRINGS BY NAME .rs .sp .B int pcre_copy_named_substring(const pcre *\fIcode\fR, .ti +5n .B const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, const char *\fIstringname\fR, .ti +5n .B char *\fIbuffer\fR, int \fIbuffersize\fR); .PP .br .B int pcre_get_stringnumber(const pcre *\fIcode\fR, .ti +5n .B const char *\fIname\fR); .PP .br .B int pcre_get_named_substring(const pcre *\fIcode\fR, .ti +5n .B const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, const char *\fIstringname\fR, .ti +5n .B const char **\fIstringptr\fR); .PP To extract a substring by name, you first have to find associated number. This can be done by calling \fBpcre_get_stringnumber()\fR. The first argument is the compiled pattern, and the second is the name. For example, for this pattern ab(?\\d+)... the number of the subpattern called "xxx" is 1. Given the number, you can then extract the substring directly, or use one of the functions described in the previous section. For convenience, there are also two functions that do the whole job. Most of the arguments of \fIpcre_copy_named_substring()\fR and \fIpcre_get_named_substring()\fR are the same as those for the functions that extract by number, and so are not re-described here. There are just two differences. First, instead of a substring number, a substring name is given. Second, there is an extra argument, given at the start, which is a pointer to the compiled pattern. This is needed in order to gain access to the name-to-number translation table. These functions call \fBpcre_get_stringnumber()\fR, and if it succeeds, they then call \fIpcre_copy_substring()\fR or \fIpcre_get_substring()\fR, as appropriate. .in 0 Last updated: 09 December 2003 .br Copyright (c) 1997-2003 University of Cambridge. 07070100014565000081a40000000a0000000a00000001402cbd6500001603000000880000000500000000000000000000001fff350892reloc/doc/pcre/doc/pcrebuild.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH PCRE BUILD-TIME OPTIONS .rs .sp This document describes the optional features of PCRE that can be selected when the library is compiled. They are all selected, or deselected, by providing options to the \fBconfigure\fR script which is run before the \fBmake\fR command. The complete list of options for \fBconfigure\fR (which includes the standard ones such as the selection of the installation directory) can be obtained by running ./configure --help The following sections describe certain options whose names begin with --enable or --disable. These settings specify changes to the defaults for the \fBconfigure\fR command. Because of the way that \fBconfigure\fR works, --enable and --disable always come in pairs, so the complementary option always exists as well, but as it specifies the default, it is not described. .SH UTF-8 SUPPORT .rs .sp To build PCRE with support for UTF-8 character strings, add --enable-utf8 to the \fBconfigure\fR command. Of itself, this does not make PCRE treat strings as UTF-8. As well as compiling PCRE with this option, you also have have to set the PCRE_UTF8 option when you call the \fBpcre_compile()\fR function. .SH CODE VALUE OF NEWLINE .rs .sp By default, PCRE treats character 10 (linefeed) as the newline character. This is the normal newline character on Unix-like systems. You can compile PCRE to use character 13 (carriage return) instead by adding --enable-newline-is-cr to the \fBconfigure\fR command. For completeness there is also a --enable-newline-is-lf option, which explicitly specifies linefeed as the newline character. .SH BUILDING SHARED AND STATIC LIBRARIES .rs .sp The PCRE building process uses \fBlibtool\fR to build both shared and static Unix libraries by default. You can suppress one of these by adding one of --disable-shared --disable-static to the \fBconfigure\fR command, as required. .SH POSIX MALLOC USAGE .rs .sp When PCRE is called through the POSIX interface (see the \fBpcreposix\fR documentation), additional working storage is required for holding the pointers to capturing substrings because PCRE requires three integers per substring, whereas the POSIX interface provides only two. If the number of expected substrings is small, the wrapper function uses space on the stack, because this is faster than using \fBmalloc()\fR for each call. The default threshold above which the stack is no longer used is 10; it can be changed by adding a setting such as --with-posix-malloc-threshold=20 to the \fBconfigure\fR command. .SH LIMITING PCRE RESOURCE USAGE .rs .sp Internally, PCRE has a function called \fBmatch()\fR which it calls repeatedly (possibly recursively) when performing a matching operation. By limiting the number of times this function may be called, a limit can be placed on the resources used by a single call to \fBpcre_exec()\fR. The limit can be changed at run time, as described in the \fBpcreapi\fR documentation. The default is 10 million, but this can be changed by adding a setting such as --with-match-limit=500000 to the \fBconfigure\fR command. .SH HANDLING VERY LARGE PATTERNS .rs .sp Within a compiled pattern, offset values are used to point from one part to another (for example, from an opening parenthesis to an alternation metacharacter). By default two-byte values are used for these offsets, leading to a maximum size for a compiled pattern of around 64K. This is sufficient to handle all but the most gigantic patterns. Nevertheless, some people do want to process enormous patterns, so it is possible to compile PCRE to use three-byte or four-byte offsets by adding a setting such as --with-link-size=3 to the \fBconfigure\fR command. The value given must be 2, 3, or 4. Using longer offsets slows down the operation of PCRE because it has to load additional bytes when handling them. If you build PCRE with an increased link size, test 2 (and test 5 if you are using UTF-8) will fail. Part of the output of these tests is a representation of the compiled pattern, and this changes with the link size. .SH AVOIDING EXCESSIVE STACK USAGE .rs .sp PCRE implements backtracking while matching by making recursive calls to an internal function called \fBmatch()\fR. In environments where the size of the stack is limited, this can severely limit PCRE's operation. (The Unix environment does not usually suffer from this problem.) An alternative approach that uses memory from the heap to remember data, instead of using recursive function calls, has been implemented to work round this problem. If you want to build a version of PCRE that works this way, add --disable-stack-for-recursion to the \fBconfigure\fR command. With this configuration, PCRE will use the \fBpcre_stack_malloc\fR and \fBpcre_stack_free\fR variables to call memory management functions. Separate functions are provided because the usage is very predictable: the block sizes requested are always the same, and the blocks are always freed in reverse order. A calling program might be able to implement optimized functions that perform better than the standard \fBmalloc()\fR and \fBfree()\fR functions. PCRE runs noticeably more slowly when built in this way. .SH USING EBCDIC CODE .rs .sp PCRE assumes by default that it will run in an environment where the character code is ASCII (or UTF-8, which is a superset of ASCII). PCRE can, however, be compiled to run in an EBCDIC environment by adding --enable-ebcdic to the \fBconfigure\fR command. .in 0 Last updated: 09 December 2003 .br Copyright (c) 1997-2003 University of Cambridge. 07070100014566000081a40000000a0000000a00000001402cbd6500000f520000008800000005000000000000000000000021ff350892reloc/doc/pcre/doc/pcrecallout.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH PCRE CALLOUTS .rs .sp .B int (*pcre_callout)(pcre_callout_block *); .PP PCRE provides a feature called "callout", which is a means of temporarily passing control to the caller of PCRE in the middle of pattern matching. The caller of PCRE provides an external function by putting its entry point in the global variable \fIpcre_callout\fR. By default, this variable contains NULL, which disables all calling out. Within a regular expression, (?C) indicates the points at which the external function is to be called. Different callout points can be identified by putting a number less than 256 after the letter C. The default value is zero. For example, this pattern has two callout points: (?C1)\dabc(?C2)def During matching, when PCRE reaches a callout point (and \fIpcre_callout\fR is set), the external function is called. Its only argument is a pointer to a \fBpcre_callout\fR block. This contains the following variables: int \fIversion\fR; int \fIcallout_number\fR; int *\fIoffset_vector\fR; const char *\fIsubject\fR; int \fIsubject_length\fR; int \fIstart_match\fR; int \fIcurrent_position\fR; int \fIcapture_top\fR; int \fIcapture_last\fR; void *\fIcallout_data\fR; The \fIversion\fR field is an integer containing the version number of the block format. The current version is zero. The version number may change in future if additional fields are added, but the intention is never to remove any of the existing fields. The \fIcallout_number\fR field contains the number of the callout, as compiled into the pattern (that is, the number after ?C). The \fIoffset_vector\fR field is a pointer to the vector of offsets that was passed by the caller to \fBpcre_exec()\fR. The contents can be inspected in order to extract substrings that have been matched so far, in the same way as for extracting substrings after a match has completed. The \fIsubject\fR and \fIsubject_length\fR fields contain copies the values that were passed to \fBpcre_exec()\fR. The \fIstart_match\fR field contains the offset within the subject at which the current match attempt started. If the pattern is not anchored, the callout function may be called several times for different starting points. The \fIcurrent_position\fR field contains the offset within the subject of the current match pointer. The \fIcapture_top\fR field contains one more than the number of the highest numbered captured substring so far. If no substrings have been captured, the value of \fIcapture_top\fR is one. The \fIcapture_last\fR field contains the number of the most recently captured substring. The \fIcallout_data\fR field contains a value that is passed to \fBpcre_exec()\fR by the caller specifically so that it can be passed back in callouts. It is passed in the \fIpcre_callout\fR field of the \fBpcre_extra\fR data structure. If no such data was passed, the value of \fIcallout_data\fR in a \fBpcre_callout\fR block is NULL. There is a description of the \fBpcre_extra\fR structure in the \fBpcreapi\fR documentation. .SH RETURN VALUES .rs .sp The callout function returns an integer. If the value is zero, matching proceeds as normal. If the value is greater than zero, matching fails at the current point, but backtracking to test other possibilities goes ahead, just as if a lookahead assertion had failed. If the value is less than zero, the match is abandoned, and \fBpcre_exec()\fR returns the value. Negative values should normally be chosen from the set of PCRE_ERROR_xxx values. In particular, PCRE_ERROR_NOMATCH forces a standard "no match" failure. The error number PCRE_ERROR_CALLOUT is reserved for use by callout functions; it will never be used by PCRE itself. .in 0 Last updated: 21 January 2003 .br Copyright (c) 1997-2003 University of Cambridge. 07070100014567000081a40000000a0000000a00000001402cbd65000011030000008800000005000000000000000000000020ff350892reloc/doc/pcre/doc/pcrecompat.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH DIFFERENCES FROM PERL .rs .sp This document describes the differences in the ways that PCRE and Perl handle regular expressions. The differences described here are with respect to Perl 5.8. 1. PCRE does not have full UTF-8 support. Details of what it does have are given in the .\" HTML .\" section on UTF-8 support .\" in the main .\" HREF \fBpcre\fR .\" page. 2. PCRE does not allow repeat quantifiers on lookahead assertions. Perl permits them, but they do not mean what you might think. For example, (?!a){3} does not assert that the next three characters are not "a". It just asserts that the next character is not "a" three times. 3. Capturing subpatterns that occur inside negative lookahead assertions are counted, but their entries in the offsets vector are never set. Perl sets its numerical variables from any such patterns that are matched before the assertion fails to match something (thereby succeeding), but only if the negative lookahead assertion contains just one branch. 4. Though binary zero characters are supported in the subject string, they are not allowed in a pattern string because it is passed as a normal C string, terminated by zero. The escape sequence "\\0" can be used in the pattern to represent a binary zero. 5. The following Perl escape sequences are not supported: \\l, \\u, \\L, \\U, \\P, \\p, \\N, and \\X. In fact these are implemented by Perl's general string-handling and are not part of its pattern matching engine. If any of these are encountered by PCRE, an error is generated. 6. PCRE does support the \\Q...\\E escape for quoting substrings. Characters in between are treated as literals. This is slightly different from Perl in that $ and @ are also handled as literals inside the quotes. In Perl, they cause variable interpolation (but of course PCRE does not have variables). Note the following examples: Pattern PCRE matches Perl matches \\Qabc$xyz\\E abc$xyz abc followed by the contents of $xyz \\Qabc\\$xyz\\E abc\\$xyz abc\\$xyz \\Qabc\\E\\$\\Qxyz\\E abc$xyz abc$xyz The \\Q...\\E sequence is recognized both inside and outside character classes. 7. Fairly obviously, PCRE does not support the (?{code}) and (?p{code}) constructions. However, there is some experimental support for recursive patterns using the non-Perl items (?R), (?number) and (?P>name). Also, the PCRE "callout" feature allows an external function to be called during pattern matching. 8. There are some differences that are concerned with the settings of captured strings when part of a pattern is repeated. For example, matching "aba" against the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE it is set to "b". 9. PCRE provides some extensions to the Perl regular expression facilities: (a) Although lookbehind assertions must match fixed length strings, each alternative branch of a lookbehind assertion can match a different length of string. Perl requires them all to have the same length. (b) If PCRE_DOLLAR_ENDONLY is set and PCRE_MULTILINE is not set, the $ meta-character matches only at the very end of the string. (c) If PCRE_EXTRA is set, a backslash followed by a letter with no special meaning is faulted. (d) If PCRE_UNGREEDY is set, the greediness of the repetition quantifiers is inverted, that is, by default they are not greedy, but if followed by a question mark they are. (e) PCRE_ANCHORED can be used to force a pattern to be tried only at the first matching position in the subject string. (f) The PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, and PCRE_NO_AUTO_CAPTURE options for \fBpcre_exec()\fR have no Perl equivalents. (g) The (?R), (?number), and (?P>name) constructs allows for recursive pattern matching (Perl can do this using the (?p{code}) construct, which PCRE cannot support.) (h) PCRE supports named capturing substrings, using the Python syntax. (i) PCRE supports the possessive quantifier "++" syntax, taken from Sun's Java package. (j) The (R) condition, for testing recursion, is a PCRE extension. (k) The callout facility is PCRE-specific. .in 0 Last updated: 09 December 2003 .br Copyright (c) 1997-2003 University of Cambridge. 07070100014568000081a40000000a0000000a00000001402cbd6500000fda000000880000000500000000000000000000001eff350892reloc/doc/pcre/doc/pcregrep.1.TH PCREGREP 1 .SH NAME pcregrep - a grep with Perl-compatible regular expressions. .SH SYNOPSIS .B pcregrep [-Vcfhilnrsuvx] [long options] [pattern] [file1 file2 ...] .SH DESCRIPTION .rs .sp \fBpcregrep\fR searches files for character patterns, in the same way as other grep commands do, but it uses the PCRE regular expression library to support patterns that are compatible with the regular expressions of Perl 5. See .\" HREF \fBpcrepattern\fR .\" for a full description of syntax and semantics of the regular expressions that PCRE supports. A pattern must be specified on the command line unless the \fB-f\fR option is used (see below). If no files are specified, \fBpcregrep\fR reads the standard input. By default, each line that matches the pattern is copied to the standard output, and if there is more than one file, the file name is printed before each line of output. However, there are options that can change how \fBpcregrep\fR behaves. Lines are limited to BUFSIZ characters. BUFSIZ is defined in \fB\fR. The newline character is removed from the end of each line before it is matched against the pattern. .SH OPTIONS .rs .sp .TP 10 \fB-V\fR Write the version number of the PCRE library being used to the standard error stream. .TP \fB-c\fR Do not print individual lines; instead just print a count of the number of lines that would otherwise have been printed. If several files are given, a count is printed for each of them. .TP \fB-f\fR\fIfilename\fR Read a number of patterns from the file, one per line, and match all of them against each line of input. A line is output if any of the patterns match it. When \fB-f\fR is used, no pattern is taken from the command line; all arguments are treated as file names. There is a maximum of 100 patterns. Trailing white space is removed, and blank lines are ignored. An empty file contains no patterns and therefore matches nothing. .TP \fB-h\fR Suppress printing of filenames when searching multiple files. .TP \fB-i\fR Ignore upper/lower case distinctions during comparisons. .TP \fB-l\fR Instead of printing lines from the files, just print the names of the files containing lines that would have been printed. Each file name is printed once, on a separate line. .TP \fB-n\fR Precede each line by its line number in the file. .TP \fB-r\fR If any file is a directory, recursively scan the files it contains. Without \fB-r\fR a directory is scanned as a normal file. .TP \fB-s\fR Work silently, that is, display nothing except error messages. The exit status indicates whether any matches were found. .TP \fB-u\fR Operate in UTF-8 mode. This option is available only if PCRE has been compiled with UTF-8 support. Both the pattern and each subject line are assumed to be valid strings of UTF-8 characters. .TP \fB-v\fR Invert the sense of the match, so that lines which do \fInot\fR match the pattern are now the ones that are found. .TP \fB-x\fR Force the pattern to be anchored (it must start matching at the beginning of the line) and in addition, require it to match the entire line. This is equivalent to having ^ and $ characters at the start and end of each alternative branch in the regular expression. .SH LONG OPTIONS .rs .sp Long forms of all the options are available, as in GNU grep. They are shown in the following table: -c --count -h --no-filename -i --ignore-case -l --files-with-matches -n --line-number -r --recursive -s --no-messages -u --utf-8 -V --version -v --invert-match -x --line-regex -x --line-regexp In addition, --file=\fIfilename\fR is equivalent to -f\fIfilename\fR, and --help shows the list of options and then exits. .SH DIAGNOSTICS .rs .sp Exit status is 0 if any matches were found, 1 if no matches were found, and 2 for syntax errors or inacessible files (even if matches were found). .SH AUTHOR .rs .sp Philip Hazel .br University Computing Service .br Cambridge CB2 3QG, England. .in 0 Last updated: 03 February 2003 .br Copyright (c) 1997-2003 University of Cambridge. 07070100014569000081a40000000a0000000a00000001402cbd65000012cf0000008800000005000000000000000000000020ff350892reloc/doc/pcre/doc/pcregrep.txtPCREGREP(1) PCREGREP(1) NAME pcregrep - a grep with Perl-compatible regular expressions. SYNOPSIS pcregrep [-Vcfhilnrsuvx] [long options] [pattern] [file1 file2 ...] DESCRIPTION pcregrep searches files for character patterns, in the same way as other grep commands do, but it uses the PCRE regular expression library to support patterns that are compatible with the regular expressions of Perl 5. See pcrepattern for a full description of syntax and semantics of the regular expressions that PCRE supports. A pattern must be specified on the command line unless the -f option is used (see below). If no files are specified, pcregrep reads the standard input. By default, each line that matches the pattern is copied to the standard output, and if there is more than one file, the file name is printed before each line of output. However, there are options that can change how pcregrep behaves. Lines are limited to BUFSIZ characters. BUFSIZ is defined in . The newline character is removed from the end of each line before it is matched against the pattern. OPTIONS -V Write the version number of the PCRE library being used to the standard error stream. -c Do not print individual lines; instead just print a count of the number of lines that would otherwise have been printed. If several files are given, a count is printed for each of them. -ffilename Read a number of patterns from the file, one per line, and match all of them against each line of input. A line is out- put if any of the patterns match it. When -f is used, no pattern is taken from the command line; all arguments are treated as file names. There is a maximum of 100 patterns. Trailing white space is removed, and blank lines are ignored. An empty file contains no patterns and therefore matches nothing. -h Suppress printing of filenames when searching multiple files. -i Ignore upper/lower case distinctions during comparisons. -l Instead of printing lines from the files, just print the names of the files containing lines that would have been printed. Each file name is printed once, on a separate line. -n Precede each line by its line number in the file. -r If any file is a directory, recursively scan the files it contains. Without -r a directory is scanned as a normal file. -s Work silently, that is, display nothing except error mes- sages. The exit status indicates whether any matches were found. -u Operate in UTF-8 mode. This option is available only if PCRE has been compiled with UTF-8 support. Both the pattern and each subject line are assumed to be valid strings of UTF-8 characters. -v Invert the sense of the match, so that lines which do not match the pattern are now the ones that are found. -x Force the pattern to be anchored (it must start matching at the beginning of the line) and in addition, require it to match the entire line. This is equivalent to having ^ and $ characters at the start and end of each alternative branch in the regular expression. LONG OPTIONS Long forms of all the options are available, as in GNU grep. They are shown in the following table: -c --count -h --no-filename -i --ignore-case -l --files-with-matches -n --line-number -r --recursive -s --no-messages -u --utf-8 -V --version -v --invert-match -x --line-regex -x --line-regexp In addition, --file=filename is equivalent to -ffilename, and --help shows the list of options and then exits. DIAGNOSTICS Exit status is 0 if any matches were found, 1 if no matches were found, and 2 for syntax errors or inacessible files (even if matches were found). AUTHOR Philip Hazel University Computing Service Cambridge CB2 3QG, England. Last updated: 03 February 2003 Copyright (c) 1997-2003 University of Cambridge. 0707010001456a000081a40000000a0000000a00000001402cbd650000d7e40000008800000005000000000000000000000021ff350892reloc/doc/pcre/doc/pcrepattern.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH PCRE REGULAR EXPRESSION DETAILS .rs .sp The syntax and semantics of the regular expressions supported by PCRE are described below. Regular expressions are also described in the Perl documentation and in a number of other books, some of which have copious examples. Jeffrey Friedl's "Mastering Regular Expressions", published by O'Reilly, covers them in great detail. The description here is intended as reference documentation. The basic operation of PCRE is on strings of bytes. However, there is also support for UTF-8 character strings. To use this support you must build PCRE to include UTF-8 support, and then call \fBpcre_compile()\fR with the PCRE_UTF8 option. How this affects the pattern matching is mentioned in several places below. There is also a summary of UTF-8 features in the .\" HTML .\" section on UTF-8 support .\" in the main .\" HREF \fBpcre\fR .\" page. A regular expression is a pattern that is matched against a subject string from left to right. Most characters stand for themselves in a pattern, and match the corresponding characters in the subject. As a trivial example, the pattern The quick brown fox matches a portion of a subject string that is identical to itself. The power of regular expressions comes from the ability to include alternatives and repetitions in the pattern. These are encoded in the pattern by the use of \fImeta-characters\fR, which do not stand for themselves but instead are interpreted in some special way. There are two different sets of meta-characters: those that are recognized anywhere in the pattern except within square brackets, and those that are recognized in square brackets. Outside square brackets, the meta-characters are as follows: \\ general escape character with several uses ^ assert start of string (or line, in multiline mode) $ assert end of string (or line, in multiline mode) . match any character except newline (by default) [ start character class definition | start of alternative branch ( start subpattern ) end subpattern ? extends the meaning of ( also 0 or 1 quantifier also quantifier minimizer * 0 or more quantifier + 1 or more quantifier also "possessive quantifier" { start min/max quantifier Part of a pattern that is in square brackets is called a "character class". In a character class the only meta-characters are: \\ general escape character ^ negate the class, but only if the first character - indicates character range [ POSIX character class (only if followed by POSIX syntax) ] terminates the character class The following sections describe the use of each of the meta-characters. .SH BACKSLASH .rs .sp The backslash character has several uses. Firstly, if it is followed by a non-alphameric character, it takes away any special meaning that character may have. This use of backslash as an escape character applies both inside and outside character classes. For example, if you want to match a * character, you write \\* in the pattern. This escaping action applies whether or not the following character would otherwise be interpreted as a meta-character, so it is always safe to precede a non-alphameric with backslash to specify that it stands for itself. In particular, if you want to match a backslash, you write \\\\. If a pattern is compiled with the PCRE_EXTENDED option, whitespace in the pattern (other than in a character class) and characters between a # outside a character class and the next newline character are ignored. An escaping backslash can be used to include a whitespace or # character as part of the pattern. If you want to remove the special meaning from a sequence of characters, you can do so by putting them between \\Q and \\E. This is different from Perl in that $ and @ are handled as literals in \\Q...\\E sequences in PCRE, whereas in Perl, $ and @ cause variable interpolation. Note the following examples: Pattern PCRE matches Perl matches \\Qabc$xyz\\E abc$xyz abc followed by the contents of $xyz \\Qabc\\$xyz\\E abc\\$xyz abc\\$xyz \\Qabc\\E\\$\\Qxyz\\E abc$xyz abc$xyz The \\Q...\\E sequence is recognized both inside and outside character classes. A second use of backslash provides a way of encoding non-printing characters in patterns in a visible manner. There is no restriction on the appearance of non-printing characters, apart from the binary zero that terminates a pattern, but when a pattern is being prepared by text editing, it is usually easier to use one of the following escape sequences than the binary character it represents: \\a alarm, that is, the BEL character (hex 07) \\cx "control-x", where x is any character \\e escape (hex 1B) \\f formfeed (hex 0C) \\n newline (hex 0A) \\r carriage return (hex 0D) \\t tab (hex 09) \\ddd character with octal code ddd, or backreference \\xhh character with hex code hh \\x{hhh..} character with hex code hhh... (UTF-8 mode only) The precise effect of \\cx is as follows: if x is a lower case letter, it is converted to upper case. Then bit 6 of the character (hex 40) is inverted. Thus \\cz becomes hex 1A, but \\c{ becomes hex 3B, while \\c; becomes hex 7B. After \\x, from zero to two hexadecimal digits are read (letters can be in upper or lower case). In UTF-8 mode, any number of hexadecimal digits may appear between \\x{ and }, but the value of the character code must be less than 2**31 (that is, the maximum hexadecimal value is 7FFFFFFF). If characters other than hexadecimal digits appear between \\x{ and }, or if there is no terminating }, this form of escape is not recognized. Instead, the initial \\x will be interpreted as a basic hexadecimal escape, with no following digits, giving a byte whose value is zero. Characters whose value is less than 256 can be defined by either of the two syntaxes for \\x when PCRE is in UTF-8 mode. There is no difference in the way they are handled. For example, \\xdc is exactly the same as \\x{dc}. After \\0 up to two further octal digits are read. In both cases, if there are fewer than two digits, just those that are present are used. Thus the sequence \\0\\x\\07 specifies two binary zeros followed by a BEL character (code value 7). Make sure you supply two digits after the initial zero if the character that follows is itself an octal digit. The handling of a backslash followed by a digit other than 0 is complicated. Outside a character class, PCRE reads it and any following digits as a decimal number. If the number is less than 10, or if there have been at least that many previous capturing left parentheses in the expression, the entire sequence is taken as a \fIback reference\fR. A description of how this works is given later, following the discussion of parenthesized subpatterns. Inside a character class, or if the decimal number is greater than 9 and there have not been that many capturing subpatterns, PCRE re-reads up to three octal digits following the backslash, and generates a single byte from the least significant 8 bits of the value. Any subsequent digits stand for themselves. For example: \\040 is another way of writing a space \\40 is the same, provided there are fewer than 40 previous capturing subpatterns \\7 is always a back reference \\11 might be a back reference, or another way of writing a tab \\011 is always a tab \\0113 is a tab followed by the character "3" \\113 might be a back reference, otherwise the character with octal code 113 \\377 might be a back reference, otherwise the byte consisting entirely of 1 bits \\81 is either a back reference, or a binary zero followed by the two characters "8" and "1" Note that octal values of 100 or greater must not be introduced by a leading zero, because no more than three octal digits are ever read. All the sequences that define a single byte value or a single UTF-8 character (in UTF-8 mode) can be used both inside and outside character classes. In addition, inside a character class, the sequence \\b is interpreted as the backspace character (hex 08). Outside a character class it has a different meaning (see below). The third use of backslash is for specifying generic character types: \\d any decimal digit \\D any character that is not a decimal digit \\s any whitespace character \\S any character that is not a whitespace character \\w any "word" character \\W any "non-word" character Each pair of escape sequences partitions the complete set of characters into two disjoint sets. Any given character matches one, and only one, of each pair. In UTF-8 mode, characters with values greater than 255 never match \\d, \\s, or \\w, and always match \\D, \\S, and \\W. For compatibility with Perl, \\s does not match the VT character (code 11). This makes it different from the the POSIX "space" class. The \\s characters are HT (9), LF (10), FF (12), CR (13), and space (32). A "word" character is any letter or digit or the underscore character, that is, any character which can be part of a Perl "word". The definition of letters and digits is controlled by PCRE's character tables, and may vary if locale- specific matching is taking place (see .\" HTML .\" "Locale support" .\" in the .\" HREF \fBpcreapi\fR .\" page). For example, in the "fr" (French) locale, some character codes greater than 128 are used for accented letters, and these are matched by \\w. These character type sequences can appear both inside and outside character classes. They each match one character of the appropriate type. If the current matching point is at the end of the subject string, all of them fail, since there is no character to match. The fourth use of backslash is for certain simple assertions. An assertion specifies a condition that has to be met at a particular point in a match, without consuming any characters from the subject string. The use of subpatterns for more complicated assertions is described below. The backslashed assertions are \\b matches at a word boundary \\B matches when not at a word boundary \\A matches at start of subject \\Z matches at end of subject or before newline at end \\z matches at end of subject \\G matches at first matching position in subject These assertions may not appear in character classes (but note that \\b has a different meaning, namely the backspace character, inside a character class). A word boundary is a position in the subject string where the current character and the previous character do not both match \\w or \\W (i.e. one matches \\w and the other matches \\W), or the start or end of the string if the first or last character matches \\w, respectively. The \\A, \\Z, and \\z assertions differ from the traditional circumflex and dollar (described below) in that they only ever match at the very start and end of the subject string, whatever options are set. Thus, they are independent of multiline mode. They are not affected by the PCRE_NOTBOL or PCRE_NOTEOL options. If the \fIstartoffset\fR argument of \fBpcre_exec()\fR is non-zero, indicating that matching is to start at a point other than the beginning of the subject, \\A can never match. The difference between \\Z and \\z is that \\Z matches before a newline that is the last character of the string as well as at the end of the string, whereas \\z matches only at the end. The \\G assertion is true only when the current matching position is at the start point of the match, as specified by the \fIstartoffset\fR argument of \fBpcre_exec()\fR. It differs from \\A when the value of \fIstartoffset\fR is non-zero. By calling \fBpcre_exec()\fR multiple times with appropriate arguments, you can mimic Perl's /g option, and it is in this kind of implementation where \\G can be useful. Note, however, that PCRE's interpretation of \\G, as the start of the current match, is subtly different from Perl's, which defines it as the end of the previous match. In Perl, these can be different when the previously matched string was empty. Because PCRE does just one match at a time, it cannot reproduce this behaviour. If all the alternatives of a pattern begin with \\G, the expression is anchored to the starting match position, and the "anchored" flag is set in the compiled regular expression. .SH CIRCUMFLEX AND DOLLAR .rs .sp Outside a character class, in the default matching mode, the circumflex character is an assertion which is true only if the current matching point is at the start of the subject string. If the \fIstartoffset\fR argument of \fBpcre_exec()\fR is non-zero, circumflex can never match if the PCRE_MULTILINE option is unset. Inside a character class, circumflex has an entirely different meaning (see below). Circumflex need not be the first character of the pattern if a number of alternatives are involved, but it should be the first thing in each alternative in which it appears if the pattern is ever to match that branch. If all possible alternatives start with a circumflex, that is, if the pattern is constrained to match only at the start of the subject, it is said to be an "anchored" pattern. (There are also other constructs that can cause a pattern to be anchored.) A dollar character is an assertion which is true only if the current matching point is at the end of the subject string, or immediately before a newline character that is the last character in the string (by default). Dollar need not be the last character of the pattern if a number of alternatives are involved, but it should be the last item in any branch in which it appears. Dollar has no special meaning in a character class. The meaning of dollar can be changed so that it matches only at the very end of the string, by setting the PCRE_DOLLAR_ENDONLY option at compile time. This does not affect the \\Z assertion. The meanings of the circumflex and dollar characters are changed if the PCRE_MULTILINE option is set. When this is the case, they match immediately after and immediately before an internal newline character, respectively, in addition to matching at the start and end of the subject string. For example, the pattern /^abc$/ matches the subject string "def\\nabc" in multiline mode, but not otherwise. Consequently, patterns that are anchored in single line mode because all branches start with ^ are not anchored in multiline mode, and a match for circumflex is possible when the \fIstartoffset\fR argument of \fBpcre_exec()\fR is non-zero. The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is set. Note that the sequences \\A, \\Z, and \\z can be used to match the start and end of the subject in both modes, and if all branches of a pattern start with \\A it is always anchored, whether PCRE_MULTILINE is set or not. .SH FULL STOP (PERIOD, DOT) .rs .sp Outside a character class, a dot in the pattern matches any one character in the subject, including a non-printing character, but not (by default) newline. In UTF-8 mode, a dot matches any UTF-8 character, which might be more than one byte long, except (by default) for newline. If the PCRE_DOTALL option is set, dots match newlines as well. The handling of dot is entirely independent of the handling of circumflex and dollar, the only relationship being that they both involve newline characters. Dot has no special meaning in a character class. .SH MATCHING A SINGLE BYTE .rs .sp Outside a character class, the escape sequence \\C matches any one byte, both in and out of UTF-8 mode. Unlike a dot, it always matches a newline. The feature is provided in Perl in order to match individual bytes in UTF-8 mode. Because it breaks up UTF-8 characters into individual bytes, what remains in the string may be a malformed UTF-8 string. For this reason it is best avoided. PCRE does not allow \\C to appear in lookbehind assertions (see below), because in UTF-8 mode it makes it impossible to calculate the length of the lookbehind. .SH SQUARE BRACKETS .rs .sp An opening square bracket introduces a character class, terminated by a closing square bracket. A closing square bracket on its own is not special. If a closing square bracket is required as a member of the class, it should be the first data character in the class (after an initial circumflex, if present) or escaped with a backslash. A character class matches a single character in the subject. In UTF-8 mode, the character may occupy more than one byte. A matched character must be in the set of characters defined by the class, unless the first character in the class definition is a circumflex, in which case the subject character must not be in the set defined by the class. If a circumflex is actually required as a member of the class, ensure it is not the first character, or escape it with a backslash. For example, the character class [aeiou] matches any lower case vowel, while [^aeiou] matches any character that is not a lower case vowel. Note that a circumflex is just a convenient notation for specifying the characters which are in the class by enumerating those that are not. It is not an assertion: it still consumes a character from the subject string, and fails if the current pointer is at the end of the string. In UTF-8 mode, characters with values greater than 255 can be included in a class as a literal string of bytes, or by using the \\x{ escaping mechanism. When caseless matching is set, any letters in a class represent both their upper case and lower case versions, so for example, a caseless [aeiou] matches "A" as well as "a", and a caseless [^aeiou] does not match "A", whereas a caseful version would. PCRE does not support the concept of case for characters with values greater than 255. The newline character is never treated in any special way in character classes, whatever the setting of the PCRE_DOTALL or PCRE_MULTILINE options is. A class such as [^a] will always match a newline. The minus (hyphen) character can be used to specify a range of characters in a character class. For example, [d-m] matches any letter between d and m, inclusive. If a minus character is required in a class, it must be escaped with a backslash or appear in a position where it cannot be interpreted as indicating a range, typically as the first or last character in the class. It is not possible to have the literal character "]" as the end character of a range. A pattern such as [W-]46] is interpreted as a class of two characters ("W" and "-") followed by a literal string "46]", so it would match "W46]" or "-46]". However, if the "]" is escaped with a backslash it is interpreted as the end of range, so [W-\\]46] is interpreted as a single class containing a range followed by two separate characters. The octal or hexadecimal representation of "]" can also be used to end a range. Ranges operate in the collating sequence of character values. They can also be used for characters specified numerically, for example [\\000-\\037]. In UTF-8 mode, ranges can include characters whose values are greater than 255, for example [\\x{100}-\\x{2ff}]. If a range that includes letters is used when caseless matching is set, it matches the letters in either case. For example, [W-c] is equivalent to [][\\^_`wxyzabc], matched caselessly, and if character tables for the "fr" locale are in use, [\\xc8-\\xcb] matches accented E characters in both cases. The character types \\d, \\D, \\s, \\S, \\w, and \\W may also appear in a character class, and add the characters that they match to the class. For example, [\\dABCDEF] matches any hexadecimal digit. A circumflex can conveniently be used with the upper case character types to specify a more restricted set of characters than the matching lower case type. For example, the class [^\\W_] matches any letter or digit, but not underscore. All non-alphameric characters other than \\, -, ^ (at the start) and the terminating ] are non-special in character classes, but it does no harm if they are escaped. .SH POSIX CHARACTER CLASSES .rs .sp Perl supports the POSIX notation for character classes, which uses names enclosed by [: and :] within the enclosing square brackets. PCRE also supports this notation. For example, [01[:alpha:]%] matches "0", "1", any alphabetic character, or "%". The supported class names are alnum letters and digits alpha letters ascii character codes 0 - 127 blank space or tab only cntrl control characters digit decimal digits (same as \\d) graph printing characters, excluding space lower lower case letters print printing characters, including space punct printing characters, excluding letters and digits space white space (not quite the same as \\s) upper upper case letters word "word" characters (same as \\w) xdigit hexadecimal digits The "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), and space (32). Notice that this list includes the VT character (code 11). This makes "space" different to \\s, which does not include VT (for Perl compatibility). The name "word" is a Perl extension, and "blank" is a GNU extension from Perl 5.8. Another Perl extension is negation, which is indicated by a ^ character after the colon. For example, [12[:^digit:]] matches "1", "2", or any non-digit. PCRE (and Perl) also recognize the POSIX syntax [.ch.] and [=ch=] where "ch" is a "collating element", but these are not supported, and an error is given if they are encountered. In UTF-8 mode, characters with values greater than 255 do not match any of the POSIX character classes. .SH VERTICAL BAR .rs .sp Vertical bar characters are used to separate alternative patterns. For example, the pattern gilbert|sullivan matches either "gilbert" or "sullivan". Any number of alternatives may appear, and an empty alternative is permitted (matching the empty string). The matching process tries each alternative in turn, from left to right, and the first one that succeeds is used. If the alternatives are within a subpattern (defined below), "succeeds" means matching the rest of the main pattern as well as the alternative in the subpattern. .SH INTERNAL OPTION SETTING .rs .sp The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and PCRE_EXTENDED options can be changed from within the pattern by a sequence of Perl option letters enclosed between "(?" and ")". The option letters are i for PCRE_CASELESS m for PCRE_MULTILINE s for PCRE_DOTALL x for PCRE_EXTENDED For example, (?im) sets caseless, multiline matching. It is also possible to unset these options by preceding the letter with a hyphen, and a combined setting and unsetting such as (?im-sx), which sets PCRE_CASELESS and PCRE_MULTILINE while unsetting PCRE_DOTALL and PCRE_EXTENDED, is also permitted. If a letter appears both before and after the hyphen, the option is unset. When an option change occurs at top level (that is, not inside subpattern parentheses), the change applies to the remainder of the pattern that follows. If the change is placed right at the start of a pattern, PCRE extracts it into the global options (and it will therefore show up in data extracted by the \fBpcre_fullinfo()\fR function). An option change within a subpattern affects only that part of the current pattern that follows it, so (a(?i)b)c matches abc and aBc and no other strings (assuming PCRE_CASELESS is not used). By this means, options can be made to have different settings in different parts of the pattern. Any changes made in one alternative do carry on into subsequent branches within the same subpattern. For example, (a(?i)b|c) matches "ab", "aB", "c", and "C", even though when matching "C" the first branch is abandoned before the option setting. This is because the effects of option settings happen at compile time. There would be some very weird behaviour otherwise. The PCRE-specific options PCRE_UNGREEDY and PCRE_EXTRA can be changed in the same way as the Perl-compatible options by using the characters U and X respectively. The (?X) flag setting is special in that it must always occur earlier in the pattern than any of the additional features it turns on, even when it is at top level. It is best put at the start. .SH SUBPATTERNS .rs .sp Subpatterns are delimited by parentheses (round brackets), which can be nested. Marking part of a pattern as a subpattern does two things: 1. It localizes a set of alternatives. For example, the pattern cat(aract|erpillar|) matches one of the words "cat", "cataract", or "caterpillar". Without the parentheses, it would match "cataract", "erpillar" or the empty string. 2. It sets up the subpattern as a capturing subpattern (as defined above). When the whole pattern matches, that portion of the subject string that matched the subpattern is passed back to the caller via the \fIovector\fR argument of \fBpcre_exec()\fR. Opening parentheses are counted from left to right (starting from 1) to obtain the numbers of the capturing subpatterns. For example, if the string "the red king" is matched against the pattern the ((red|white) (king|queen)) the captured substrings are "red king", "red", and "king", and are numbered 1, 2, and 3, respectively. The fact that plain parentheses fulfil two functions is not always helpful. There are often times when a grouping subpattern is required without a capturing requirement. If an opening parenthesis is followed by a question mark and a colon, the subpattern does not do any capturing, and is not counted when computing the number of any subsequent capturing subpatterns. For example, if the string "the white queen" is matched against the pattern the ((?:red|white) (king|queen)) the captured substrings are "white queen" and "queen", and are numbered 1 and 2. The maximum number of capturing subpatterns is 65535, and the maximum depth of nesting of all subpatterns, both capturing and non-capturing, is 200. As a convenient shorthand, if any option settings are required at the start of a non-capturing subpattern, the option letters may appear between the "?" and the ":". Thus the two patterns (?i:saturday|sunday) (?:(?i)saturday|sunday) match exactly the same set of strings. Because alternative branches are tried from left to right, and options are not reset until the end of the subpattern is reached, an option setting in one branch does affect subsequent branches, so the above patterns match "SUNDAY" as well as "Saturday". .SH NAMED SUBPATTERNS .rs .sp Identifying capturing parentheses by number is simple, but it can be very hard to keep track of the numbers in complicated regular expressions. Furthermore, if an expression is modified, the numbers may change. To help with the difficulty, PCRE supports the naming of subpatterns, something that Perl does not provide. The Python syntax (?P...) is used. Names consist of alphanumeric characters and underscores, and must be unique within a pattern. Named capturing parentheses are still allocated numbers as well as names. The PCRE API provides function calls for extracting the name-to-number translation table from a compiled pattern. For further details see the .\" HREF \fBpcreapi\fR .\" documentation. .SH REPETITION .rs .sp Repetition is specified by quantifiers, which can follow any of the following items: a literal data character the . metacharacter the \\C escape sequence escapes such as \\d that match single characters a character class a back reference (see next section) a parenthesized subpattern (unless it is an assertion) The general repetition quantifier specifies a minimum and maximum number of permitted matches, by giving the two numbers in curly brackets (braces), separated by a comma. The numbers must be less than 65536, and the first must be less than or equal to the second. For example: z{2,4} matches "zz", "zzz", or "zzzz". A closing brace on its own is not a special character. If the second number is omitted, but the comma is present, there is no upper limit; if the second number and the comma are both omitted, the quantifier specifies an exact number of required matches. Thus [aeiou]{3,} matches at least 3 successive vowels, but may match many more, while \\d{8} matches exactly 8 digits. An opening curly bracket that appears in a position where a quantifier is not allowed, or one that does not match the syntax of a quantifier, is taken as a literal character. For example, {,6} is not a quantifier, but a literal string of four characters. In UTF-8 mode, quantifiers apply to UTF-8 characters rather than to individual bytes. Thus, for example, \\x{100}{2} matches two UTF-8 characters, each of which is represented by a two-byte sequence. The quantifier {0} is permitted, causing the expression to behave as if the previous item and the quantifier were not present. For convenience (and historical compatibility) the three most common quantifiers have single-character abbreviations: * is equivalent to {0,} + is equivalent to {1,} ? is equivalent to {0,1} It is possible to construct infinite loops by following a subpattern that can match no characters with a quantifier that has no upper limit, for example: (a?)* Earlier versions of Perl and PCRE used to give an error at compile time for such patterns. However, because there are cases where this can be useful, such patterns are now accepted, but if any repetition of the subpattern does in fact match no characters, the loop is forcibly broken. By default, the quantifiers are "greedy", that is, they match as much as possible (up to the maximum number of permitted times), without causing the rest of the pattern to fail. The classic example of where this gives problems is in trying to match comments in C programs. These appear between the sequences /* and */ and within the sequence, individual * and / characters may appear. An attempt to match C comments by applying the pattern /\\*.*\\*/ to the string /* first command */ not comment /* second comment */ fails, because it matches the entire string owing to the greediness of the .* item. However, if a quantifier is followed by a question mark, it ceases to be greedy, and instead matches the minimum number of times possible, so the pattern /\\*.*?\\*/ does the right thing with the C comments. The meaning of the various quantifiers is not otherwise changed, just the preferred number of matches. Do not confuse this use of question mark with its use as a quantifier in its own right. Because it has two uses, it can sometimes appear doubled, as in \\d??\\d which matches one digit by preference, but can match two if that is the only way the rest of the pattern matches. If the PCRE_UNGREEDY option is set (an option which is not available in Perl), the quantifiers are not greedy by default, but individual ones can be made greedy by following them with a question mark. In other words, it inverts the default behaviour. When a parenthesized subpattern is quantified with a minimum repeat count that is greater than 1 or with a limited maximum, more store is required for the compiled pattern, in proportion to the size of the minimum or maximum. If a pattern starts with .* or .{0,} and the PCRE_DOTALL option (equivalent to Perl's /s) is set, thus allowing the . to match newlines, the pattern is implicitly anchored, because whatever follows will be tried against every character position in the subject string, so there is no point in retrying the overall match at any position after the first. PCRE normally treats such a pattern as though it were preceded by \\A. In cases where it is known that the subject string contains no newlines, it is worth setting PCRE_DOTALL in order to obtain this optimization, or alternatively using ^ to indicate anchoring explicitly. However, there is one situation where the optimization cannot be used. When .* is inside capturing parentheses that are the subject of a backreference elsewhere in the pattern, a match at the start may fail, and a later one succeed. Consider, for example: (.*)abc\\1 If the subject is "xyz123abc123" the match point is the fourth character. For this reason, such a pattern is not implicitly anchored. When a capturing subpattern is repeated, the value captured is the substring that matched the final iteration. For example, after (tweedle[dume]{3}\\s*)+ has matched "tweedledum tweedledee" the value of the captured substring is "tweedledee". However, if there are nested capturing subpatterns, the corresponding captured values may have been set in previous iterations. For example, after /(a|(b))+/ matches "aba" the value of the second captured substring is "b". .SH ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS .rs .sp With both maximizing and minimizing repetition, failure of what follows normally causes the repeated item to be re-evaluated to see if a different number of repeats allows the rest of the pattern to match. Sometimes it is useful to prevent this, either to change the nature of the match, or to cause it fail earlier than it otherwise might, when the author of the pattern knows there is no point in carrying on. Consider, for example, the pattern \\d+foo when applied to the subject line 123456bar After matching all 6 digits and then failing to match "foo", the normal action of the matcher is to try again with only 5 digits matching the \\d+ item, and then with 4, and so on, before ultimately failing. "Atomic grouping" (a term taken from Jeffrey Friedl's book) provides the means for specifying that once a subpattern has matched, it is not to be re-evaluated in this way. If we use atomic grouping for the previous example, the matcher would give up immediately on failing to match "foo" the first time. The notation is a kind of special parenthesis, starting with (?> as in this example: (?>\\d+)foo This kind of parenthesis "locks up" the part of the pattern it contains once it has matched, and a failure further into the pattern is prevented from backtracking into it. Backtracking past it to previous items, however, works as normal. An alternative description is that a subpattern of this type matches the string of characters that an identical standalone pattern would match, if anchored at the current point in the subject string. Atomic grouping subpatterns are not capturing subpatterns. Simple cases such as the above example can be thought of as a maximizing repeat that must swallow everything it can. So, while both \\d+ and \\d+? are prepared to adjust the number of digits they match in order to make the rest of the pattern match, (?>\\d+) can only match an entire sequence of digits. Atomic groups in general can of course contain arbitrarily complicated subpatterns, and can be nested. However, when the subpattern for an atomic group is just a single repeated item, as in the example above, a simpler notation, called a "possessive quantifier" can be used. This consists of an additional + character following a quantifier. Using this notation, the previous example can be rewritten as \\d++bar Possessive quantifiers are always greedy; the setting of the PCRE_UNGREEDY option is ignored. They are a convenient notation for the simpler forms of atomic group. However, there is no difference in the meaning or processing of a possessive quantifier and the equivalent atomic group. The possessive quantifier syntax is an extension to the Perl syntax. It originates in Sun's Java package. When a pattern contains an unlimited repeat inside a subpattern that can itself be repeated an unlimited number of times, the use of an atomic group is the only way to avoid some failing matches taking a very long time indeed. The pattern (\\D+|<\\d+>)*[!?] matches an unlimited number of substrings that either consist of non-digits, or digits enclosed in <>, followed by either ! or ?. When it matches, it runs quickly. However, if it is applied to aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa it takes a long time before reporting failure. This is because the string can be divided between the two repeats in a large number of ways, and all have to be tried. (The example used [!?] rather than a single character at the end, because both PCRE and Perl have an optimization that allows for fast failure when a single character is used. They remember the last single character that is required for a match, and fail early if it is not present in the string.) If the pattern is changed to ((?>\\D+)|<\\d+>)*[!?] sequences of non-digits cannot be broken, and failure happens quickly. .SH BACK REFERENCES .rs .sp Outside a character class, a backslash followed by a digit greater than 0 (and possibly further digits) is a back reference to a capturing subpattern earlier (that is, to its left) in the pattern, provided there have been that many previous capturing left parentheses. However, if the decimal number following the backslash is less than 10, it is always taken as a back reference, and causes an error only if there are not that many capturing left parentheses in the entire pattern. In other words, the parentheses that are referenced need not be to the left of the reference for numbers less than 10. See the section entitled "Backslash" above for further details of the handling of digits following a backslash. A back reference matches whatever actually matched the capturing subpattern in the current subject string, rather than anything matching the subpattern itself (see .\" HTML .\" "Subpatterns as subroutines" .\" below for a way of doing that). So the pattern (sens|respons)e and \\1ibility matches "sense and sensibility" and "response and responsibility", but not "sense and responsibility". If caseful matching is in force at the time of the back reference, the case of letters is relevant. For example, ((?i)rah)\\s+\\1 matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original capturing subpattern is matched caselessly. Back references to named subpatterns use the Python syntax (?P=name). We could rewrite the above example as follows: (?(?i)rah)\\s+(?P=p1) There may be more than one back reference to the same subpattern. If a subpattern has not actually been used in a particular match, any back references to it always fail. For example, the pattern (a|(bc))\\2 always fails if it starts to match "a" rather than "bc". Because there may be many capturing parentheses in a pattern, all digits following the backslash are taken as part of a potential back reference number. If the pattern continues with a digit character, some delimiter must be used to terminate the back reference. If the PCRE_EXTENDED option is set, this can be whitespace. Otherwise an empty comment can be used. A back reference that occurs inside the parentheses to which it refers fails when the subpattern is first used, so, for example, (a\\1) never matches. However, such references can be useful inside repeated subpatterns. For example, the pattern (a|b\\1)+ matches any number of "a"s and also "aba", "ababbaa" etc. At each iteration of the subpattern, the back reference matches the character string corresponding to the previous iteration. In order for this to work, the pattern must be such that the first iteration does not need to match the back reference. This can be done using alternation, as in the example above, or by a quantifier with a minimum of zero. .SH ASSERTIONS .rs .sp An assertion is a test on the characters following or preceding the current matching point that does not actually consume any characters. The simple assertions coded as \\b, \\B, \\A, \\G, \\Z, \\z, ^ and $ are described above. More complicated assertions are coded as subpatterns. There are two kinds: those that look ahead of the current position in the subject string, and those that look behind it. An assertion subpattern is matched in the normal way, except that it does not cause the current matching position to be changed. Lookahead assertions start with (?= for positive assertions and (?! for negative assertions. For example, \\w+(?=;) matches a word followed by a semicolon, but does not include the semicolon in the match, and foo(?!bar) matches any occurrence of "foo" that is not followed by "bar". Note that the apparently similar pattern (?!foo)bar does not find an occurrence of "bar" that is preceded by something other than "foo"; it finds any occurrence of "bar" whatsoever, because the assertion (?!foo) is always true when the next three characters are "bar". A lookbehind assertion is needed to achieve this effect. If you want to force a matching failure at some point in a pattern, the most convenient way to do it is with (?!) because an empty string always matches, so an assertion that requires there not to be an empty string must always fail. Lookbehind assertions start with (?<= for positive assertions and (?.*)(?<=abcd) or, equivalently, ^.*+(?<=abcd) there can be no backtracking for the .* item; it can match only the entire string. The subsequent lookbehind assertion does a single test on the last four characters. If it fails, the match fails immediately. For long strings, this approach makes a significant difference to the processing time. Several assertions (of any sort) may occur in succession. For example, (?<=\\d{3})(?[^()]+) | (?p{$re}) )* \\)}x; The (?p{...}) item interpolates Perl code at run time, and in this case refers recursively to the pattern in which it appears. Obviously, PCRE cannot support the interpolation of Perl code. Instead, it supports some special syntax for recursion of the entire pattern, and also for individual subpattern recursion. The special item that consists of (? followed by a number greater than zero and a closing parenthesis is a recursive call of the subpattern of the given number, provided that it occurs inside that subpattern. (If not, it is a "subroutine" call, which is described in the next section.) The special item (?R) is a recursive call of the entire regular expression. For example, this PCRE pattern solves the nested parentheses problem (assume the PCRE_EXTENDED option is set so that white space is ignored): \\( ( (?>[^()]+) | (?R) )* \\) First it matches an opening parenthesis. Then it matches any number of substrings which can either be a sequence of non-parentheses, or a recursive match of the pattern itself (that is a correctly parenthesized substring). Finally there is a closing parenthesis. If this were part of a larger pattern, you would not want to recurse the entire pattern, so instead you could use this: ( \\( ( (?>[^()]+) | (?1) )* \\) ) We have put the pattern into parentheses, and caused the recursion to refer to them instead of the whole pattern. In a larger pattern, keeping track of parenthesis numbers can be tricky. It may be more convenient to use named parentheses instead. For this, PCRE uses (?P>name), which is an extension to the Python syntax that PCRE uses for named parentheses (Perl does not provide named parentheses). We could rewrite the above example as follows: (?P \\( ( (?>[^()]+) | (?P>pn) )* \\) ) This particular example pattern contains nested unlimited repeats, and so the use of atomic grouping for matching strings of non-parentheses is important when applying the pattern to strings that do not match. For example, when this pattern is applied to (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() it yields "no match" quickly. However, if atomic grouping is not used, the match runs for a very long time indeed because there are so many different ways the + and * repeats can carve up the subject, and all have to be tested before failure can be reported. At the end of a match, the values set for any capturing subpatterns are those from the outermost level of the recursion at which the subpattern value is set. If you want to obtain intermediate values, a callout function can be used (see below and the .\" HREF \fBpcrecallout\fR .\" documentation). If the pattern above is matched against (ab(cd)ef) the value for the capturing parentheses is "ef", which is the last value taken on at the top level. If additional parentheses are added, giving \\( ( ( (?>[^()]+) | (?R) )* ) \\) ^ ^ ^ ^ the string they capture is "ab(cd)ef", the contents of the top level parentheses. If there are more than 15 capturing parentheses in a pattern, PCRE has to obtain extra memory to store data during a recursion, which it does by using \fBpcre_malloc\fR, freeing it via \fBpcre_free\fR afterwards. If no memory can be obtained, the match fails with the PCRE_ERROR_NOMEMORY error. Do not confuse the (?R) item with the condition (R), which tests for recursion. Consider this pattern, which matches text in angle brackets, allowing for arbitrary nesting. Only digits are allowed in nested brackets (that is, when recursing), whereas any characters are permitted at the outer level. < (?: (?(R) \\d++ | [^<>]*+) | (?R)) * > In this pattern, (?(R) is the start of a conditional subpattern, with two different alternatives for the recursive and non-recursive cases. The (?R) item is the actual recursive call. .\" HTML .SH SUBPATTERNS AS SUBROUTINES .rs .sp If the syntax for a recursive subpattern reference (either by number or by name) is used outside the parentheses to which it refers, it operates like a subroutine in a programming language. An earlier example pointed out that the pattern (sens|respons)e and \\1ibility matches "sense and sensibility" and "response and responsibility", but not "sense and responsibility". If instead the pattern (sens|respons)e and (?1)ibility is used, it does match "sense and responsibility" as well as the other two strings. Such references must, however, follow the subpattern to which they refer. .SH CALLOUTS .rs .sp Perl has a feature whereby using the sequence (?{...}) causes arbitrary Perl code to be obeyed in the middle of matching a regular expression. This makes it possible, amongst other things, to extract different substrings that match the same pair of parentheses when there is a repetition. PCRE provides a similar feature, but of course it cannot obey arbitrary Perl code. The feature is called "callout". The caller of PCRE provides an external function by putting its entry point in the global variable \fIpcre_callout\fR. By default, this variable contains NULL, which disables all calling out. Within a regular expression, (?C) indicates the points at which the external function is to be called. If you want to identify different callout points, you can put a number less than 256 after the letter C. The default value is zero. For example, this pattern has two callout points: (?C1)\dabc(?C2)def During matching, when PCRE reaches a callout point (and \fIpcre_callout\fR is set), the external function is called. It is provided with the number of the callout, and, optionally, one item of data originally supplied by the caller of \fBpcre_exec()\fR. The callout function may cause matching to backtrack, or to fail altogether. A complete description of the interface to the callout function is given in the .\" HREF \fBpcrecallout\fR .\" documentation. .in 0 Last updated: 03 February 2003 .br Copyright (c) 1997-2003 University of Cambridge. 0707010001456b000081a40000000a0000000a00000001402cbd6500000b810000008800000005000000000000000000000021ff350892reloc/doc/pcre/doc/pcreperform.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH PCRE PERFORMANCE .rs .sp Certain items that may appear in regular expression patterns are more efficient than others. It is more efficient to use a character class like [aeiou] than a set of alternatives such as (a|e|i|o|u). In general, the simplest construction that provides the required behaviour is usually the most efficient. Jeffrey Friedl's book contains a lot of discussion about optimizing regular expressions for efficient performance. When a pattern begins with .* not in parentheses, or in parentheses that are not the subject of a backreference, and the PCRE_DOTALL option is set, the pattern is implicitly anchored by PCRE, since it can match only at the start of a subject string. However, if PCRE_DOTALL is not set, PCRE cannot make this optimization, because the . metacharacter does not then match a newline, and if the subject string contains newlines, the pattern may match from the character immediately following one of them instead of from the very start. For example, the pattern .*second matches the subject "first\\nand second" (where \\n stands for a newline character), with the match starting at the seventh character. In order to do this, PCRE has to retry the match starting after every newline in the subject. If you are using such a pattern with subject strings that do not contain newlines, the best performance is obtained by setting PCRE_DOTALL, or starting the pattern with ^.* to indicate explicit anchoring. That saves PCRE from having to scan along the subject looking for a newline to restart at. Beware of patterns that contain nested indefinite repeats. These can take a long time to run when applied to a string that does not match. Consider the pattern fragment (a+)* This can match "aaaa" in 33 different ways, and this number increases very rapidly as the string gets longer. (The * repeat can match 0, 1, 2, 3, or 4 times, and for each of those cases other than 0, the + repeats can match different numbers of times.) When the remainder of the pattern is such that the entire match is going to fail, PCRE has in principle to try every possible variation, and this can take an extremely long time. An optimization catches some of the more simple cases such as (a+)*b where a literal character follows. Before embarking on the standard matching procedure, PCRE checks that there is a "b" later in the subject string, and if there is not, it fails the match immediately. However, when there is no following literal this optimization cannot be used. You can see the difference by comparing the behaviour of (a+)*\\d with the pattern above. The former gives a failure almost instantly when applied to a whole line of "a" characters, whereas the latter takes an appreciable time with strings longer than about 20 characters. .in 0 Last updated: 03 February 2003 .br Copyright (c) 1997-2003 University of Cambridge. 0707010001456c000081a40000000a0000000a00000001402cbd6500001d96000000880000000500000000000000000000001fff350892reloc/doc/pcre/doc/pcreposix.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions. .SH SYNOPSIS OF POSIX API .B #include .PP .SM .br .B int regcomp(regex_t *\fIpreg\fR, const char *\fIpattern\fR, .ti +5n .B int \fIcflags\fR); .PP .br .B int regexec(regex_t *\fIpreg\fR, const char *\fIstring\fR, .ti +5n .B size_t \fInmatch\fR, regmatch_t \fIpmatch\fR[], int \fIeflags\fR); .PP .br .B size_t regerror(int \fIerrcode\fR, const regex_t *\fIpreg\fR, .ti +5n .B char *\fIerrbuf\fR, size_t \fIerrbuf_size\fR); .PP .br .B void regfree(regex_t *\fIpreg\fR); .SH DESCRIPTION .rs .sp This set of functions provides a POSIX-style API to the PCRE regular expression package. See the .\" HREF \fBpcreapi\fR .\" documentation for a description of the native API, which contains additional functionality. The functions described here are just wrapper functions that ultimately call the PCRE native API. Their prototypes are defined in the \fBpcreposix.h\fR header file, and on Unix systems the library itself is called \fBpcreposix.a\fR, so can be accessed by adding \fB-lpcreposix\fR to the command for linking an application which uses them. Because the POSIX functions call the native ones, it is also necessary to add \fR-lpcre\fR. I have implemented only those option bits that can be reasonably mapped to PCRE native options. In addition, the options REG_EXTENDED and REG_NOSUB are defined with the value zero. They have no effect, but since programs that are written to the POSIX interface often use them, this makes it easier to slot in PCRE as a replacement library. Other POSIX options are not even defined. When PCRE is called via these functions, it is only the API that is POSIX-like in style. The syntax and semantics of the regular expressions themselves are still those of Perl, subject to the setting of various PCRE options, as described below. "POSIX-like in style" means that the API approximates to the POSIX definition; it is not fully POSIX-compatible, and in multi-byte encoding domains it is probably even less compatible. The header for these functions is supplied as \fBpcreposix.h\fR to avoid any potential clash with other POSIX libraries. It can, of course, be renamed or aliased as \fBregex.h\fR, which is the "correct" name. It provides two structure types, \fIregex_t\fR for compiled internal forms, and \fIregmatch_t\fR for returning captured substrings. It also defines some constants whose names start with "REG_"; these are used for setting options and identifying error codes. .SH COMPILING A PATTERN .rs .sp The function \fBregcomp()\fR is called to compile a pattern into an internal form. The pattern is a C string terminated by a binary zero, and is passed in the argument \fIpattern\fR. The \fIpreg\fR argument is a pointer to a regex_t structure which is used as a base for storing information about the compiled expression. The argument \fIcflags\fR is either zero, or contains one or more of the bits defined by the following macros: REG_ICASE The PCRE_CASELESS option is set when the expression is passed for compilation to the native function. REG_NEWLINE The PCRE_MULTILINE option is set when the expression is passed for compilation to the native function. Note that this does \fInot\fR mimic the defined POSIX behaviour for REG_NEWLINE (see the following section). In the absence of these flags, no options are passed to the native function. This means the the regex is compiled with PCRE default semantics. In particular, the way it handles newline characters in the subject string is the Perl way, not the POSIX way. Note that setting PCRE_MULTILINE has only \fIsome\fR of the effects specified for REG_NEWLINE. It does not affect the way newlines are matched by . (they aren't) or by a negative class such as [^a] (they are). The yield of \fBregcomp()\fR is zero on success, and non-zero otherwise. The \fIpreg\fR structure is filled in on success, and one member of the structure is public: \fIre_nsub\fR contains the number of capturing subpatterns in the regular expression. Various error codes are defined in the header file. .SH MATCHING NEWLINE CHARACTERS .rs .sp This area is not simple, because POSIX and Perl take different views of things. It is not possible to get PCRE to obey POSIX semantics, but then PCRE was never intended to be a POSIX engine. The following table lists the different possibilities for matching newline characters in PCRE: Default Change with . matches newline no PCRE_DOTALL newline matches [^a] yes not changeable $ matches \\n at end yes PCRE_DOLLARENDONLY $ matches \\n in middle no PCRE_MULTILINE ^ matches \\n in middle no PCRE_MULTILINE This is the equivalent table for POSIX: Default Change with . matches newline yes REG_NEWLINE newline matches [^a] yes REG_NEWLINE $ matches \\n at end no REG_NEWLINE $ matches \\n in middle no REG_NEWLINE ^ matches \\n in middle no REG_NEWLINE PCRE's behaviour is the same as Perl's, except that there is no equivalent for PCRE_DOLLARENDONLY in Perl. In both PCRE and Perl, there is no way to stop newline from matching [^a]. The default POSIX newline handling can be obtained by setting PCRE_DOTALL and PCRE_DOLLARENDONLY, but there is no way to make PCRE behave exactly as for the REG_NEWLINE action. .SH MATCHING A PATTERN .rs .sp The function \fBregexec()\fR is called to match a pre-compiled pattern \fIpreg\fR against a given \fIstring\fR, which is terminated by a zero byte, subject to the options in \fIeflags\fR. These can be: REG_NOTBOL The PCRE_NOTBOL option is set when calling the underlying PCRE matching function. REG_NOTEOL The PCRE_NOTEOL option is set when calling the underlying PCRE matching function. The portion of the string that was matched, and also any captured substrings, are returned via the \fIpmatch\fR argument, which points to an array of \fInmatch\fR structures of type \fIregmatch_t\fR, containing the members \fIrm_so\fR and \fIrm_eo\fR. These contain the offset to the first character of each substring and the offset to the first character after the end of each substring, respectively. The 0th element of the vector relates to the entire portion of \fIstring\fR that was matched; subsequent elements relate to the capturing subpatterns of the regular expression. Unused entries in the array have both structure members set to -1. A successful match yields a zero return; various error codes are defined in the header file, of which REG_NOMATCH is the "expected" failure code. .SH ERROR MESSAGES .rs .sp The \fBregerror()\fR function maps a non-zero errorcode from either \fBregcomp()\fR or \fBregexec()\fR to a printable message. If \fIpreg\fR is not NULL, the error should have arisen from the use of that structure. A message terminated by a binary zero is placed in \fIerrbuf\fR. The length of the message, including the zero, is limited to \fIerrbuf_size\fR. The yield of the function is the size of buffer needed to hold the whole message. .SH STORAGE .rs .sp Compiling a regular expression causes memory to be allocated and associated with the \fIpreg\fR structure. The function \fBregfree()\fR frees all such memory, after which \fIpreg\fR may no longer be used as a compiled expression. .SH AUTHOR .rs .sp Philip Hazel .br University Computing Service, .br Cambridge CB2 3QG, England. .in 0 Last updated: 03 February 2003 .br Copyright (c) 1997-2003 University of Cambridge. 0707010001456d000081a40000000a0000000a00000001402cbd650000077b0000008800000005000000000000000000000020ff350892reloc/doc/pcre/doc/pcresample.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH PCRE SAMPLE PROGRAM .rs .sp A simple, complete demonstration program, to get you started with using PCRE, is supplied in the file \fIpcredemo.c\fR in the PCRE distribution. The program compiles the regular expression that is its first argument, and matches it against the subject string in its second argument. No PCRE options are set, and default character tables are used. If matching succeeds, the program outputs the portion of the subject that matched, together with the contents of any captured substrings. If the -g option is given on the command line, the program then goes on to check for further matches of the same regular expression in the same subject string. The logic is a little bit tricky because of the possibility of matching an empty string. Comments in the code explain what is going on. On a Unix system that has PCRE installed in \fI/usr/local\fR, you can compile the demonstration program using a command like this: gcc -o pcredemo pcredemo.c -I/usr/local/include \\ -L/usr/local/lib -lpcre Then you can run simple tests like this: ./pcredemo 'cat|dog' 'the cat sat on the mat' ./pcredemo -g 'cat|dog' 'the dog sat on the cat' Note that there is a much more comprehensive test program, called \fBpcretest\fR, which supports many more facilities for testing regular expressions and the PCRE library. The \fBpcredemo\fR program is provided as a simple coding example. On some operating systems (e.g. Solaris) you may get an error like this when you try to run \fBpcredemo\fR: ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or directory This is caused by the way shared library support works on those systems. You need to add -R/usr/local/lib to the compile command to get round this problem. .in 0 Last updated: 28 January 2003 .br Copyright (c) 1997-2003 University of Cambridge. 0707010001456e000081a40000000a0000000a00000001402cbd6500003b17000000880000000500000000000000000000001eff350892reloc/doc/pcre/doc/pcretest.1.TH PCRETEST 1 .SH NAME pcretest - a program for testing Perl-compatible regular expressions. .SH SYNOPSIS .B pcretest "[-d] [-i] [-m] [-o osize] [-p] [-t] [source] [destination]" \fBpcretest\fR was written as a test program for the PCRE regular expression library itself, but it can also be used for experimenting with regular expressions. This document describes the features of the test program; for details of the regular expressions themselves, see the .\" HREF \fBpcrepattern\fR .\" documentation. For details of PCRE and its options, see the .\" HREF \fBpcreapi\fR .\" documentation. .SH OPTIONS .rs .sp .TP 10 \fB-C\fR Output the version number of the PCRE library, and all available information about the optional features that are included, and then exit. .TP 10 \fB-d\fR Behave as if each regex had the \fB/D\fR modifier (see below); the internal form is output after compilation. .TP 10 \fB-i\fR Behave as if each regex had the \fB/I\fR modifier; information about the compiled pattern is given after compilation. .TP 10 \fB-m\fR Output the size of each compiled pattern after it has been compiled. This is equivalent to adding /M to each regular expression. For compatibility with earlier versions of pcretest, \fB-s\fR is a synonym for \fB-m\fR. .TP 10 \fB-o\fR \fIosize\fR Set the number of elements in the output vector that is used when calling PCRE to be \fIosize\fR. The default value is 45, which is enough for 14 capturing subexpressions. The vector size can be changed for individual matching calls by including \\O in the data line (see below). .TP 10 \fB-p\fR Behave as if each regex has \fB/P\fR modifier; the POSIX wrapper API is used to call PCRE. None of the other options has any effect when \fB-p\fR is set. .TP 10 \fB-t\fR Run each compile, study, and match many times with a timer, and output resulting time per compile or match (in milliseconds). Do not set \fB-t\fR with \fB-m\fR, because you will then get the size output 20000 times and the timing will be distorted. .SH DESCRIPTION .rs .sp If \fBpcretest\fR is given two filename arguments, it reads from the first and writes to the second. If it is given only one filename argument, it reads from that file and writes to stdout. Otherwise, it reads from stdin and writes to stdout, and prompts for each line of input, using "re>" to prompt for regular expressions, and "data>" to prompt for data lines. The program handles any number of sets of input on a single input file. Each set starts with a regular expression, and continues with any number of data lines to be matched against the pattern. Each line is matched separately and independently. If you want to do multiple-line matches, you have to use the \\n escape sequence in a single line of input to encode the newline characters. The maximum length of data line is 30,000 characters. An empty line signals the end of the data lines, at which point a new regular expression is read. The regular expressions are given enclosed in any non-alphameric delimiters other than backslash, for example /(a|bc)x+yz/ White space before the initial delimiter is ignored. A regular expression may be continued over several input lines, in which case the newline characters are included within it. It is possible to include the delimiter within the pattern by escaping it, for example /abc\\/def/ If you do so, the escape and the delimiter form part of the pattern, but since delimiters are always non-alphameric, this does not affect its interpretation. If the terminating delimiter is immediately followed by a backslash, for example, /abc/\\ then a backslash is added to the end of the pattern. This is done to provide a way of testing the error condition that arises if a pattern finishes with a backslash, because /abc\\/ is interpreted as the first line of a pattern that starts with "abc/", causing pcretest to read the next line as a continuation of the regular expression. .SH PATTERN MODIFIERS .rs .sp The pattern may be followed by \fBi\fR, \fBm\fR, \fBs\fR, or \fBx\fR to set the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, or PCRE_EXTENDED options, respectively. For example: /caseless/i These modifier letters have the same effect as they do in Perl. There are others that set PCRE options that do not correspond to anything in Perl: \fB/A\fR, \fB/E\fR, \fB/N\fR, \fB/U\fR, and \fB/X\fR set PCRE_ANCHORED, PCRE_DOLLAR_ENDONLY, PCRE_NO_AUTO_CAPTURE, PCRE_UNGREEDY, and PCRE_EXTRA respectively. Searching for all possible matches within each subject string can be requested by the \fB/g\fR or \fB/G\fR modifier. After finding a match, PCRE is called again to search the remainder of the subject string. The difference between \fB/g\fR and \fB/G\fR is that the former uses the \fIstartoffset\fR argument to \fBpcre_exec()\fR to start searching at a new point within the entire string (which is in effect what Perl does), whereas the latter passes over a shortened substring. This makes a difference to the matching process if the pattern begins with a lookbehind assertion (including \\b or \\B). If any call to \fBpcre_exec()\fR in a \fB/g\fR or \fB/G\fR sequence matches an empty string, the next call is done with the PCRE_NOTEMPTY and PCRE_ANCHORED flags set in order to search for another, non-empty, match at the same point. If this second match fails, the start offset is advanced by one, and the normal match is retried. This imitates the way Perl handles such cases when using the \fB/g\fR modifier or the \fBsplit()\fR function. There are a number of other modifiers for controlling the way \fBpcretest\fR operates. The \fB/+\fR modifier requests that as well as outputting the substring that matched the entire pattern, pcretest should in addition output the remainder of the subject string. This is useful for tests where the subject contains multiple copies of the same substring. The \fB/L\fR modifier must be followed directly by the name of a locale, for example, /pattern/Lfr For this reason, it must be the last modifier letter. The given locale is set, \fBpcre_maketables()\fR is called to build a set of character tables for the locale, and this is then passed to \fBpcre_compile()\fR when compiling the regular expression. Without an \fB/L\fR modifier, NULL is passed as the tables pointer; that is, \fB/L\fR applies only to the expression on which it appears. The \fB/I\fR modifier requests that \fBpcretest\fR output information about the compiled expression (whether it is anchored, has a fixed first character, and so on). It does this by calling \fBpcre_fullinfo()\fR after compiling an expression, and outputting the information it gets back. If the pattern is studied, the results of that are also output. The \fB/D\fR modifier is a PCRE debugging feature, which also assumes \fB/I\fR. It causes the internal form of compiled regular expressions to be output after compilation. If the pattern was studied, the information returned is also output. The \fB/S\fR modifier causes \fBpcre_study()\fR to be called after the expression has been compiled, and the results used when the expression is matched. The \fB/M\fR modifier causes the size of memory block used to hold the compiled pattern to be output. The \fB/P\fR modifier causes \fBpcretest\fR to call PCRE via the POSIX wrapper API rather than its native API. When this is done, all other modifiers except \fB/i\fR, \fB/m\fR, and \fB/+\fR are ignored. REG_ICASE is set if \fB/i\fR is present, and REG_NEWLINE is set if \fB/m\fR is present. The wrapper functions force PCRE_DOLLAR_ENDONLY always, and PCRE_DOTALL unless REG_NEWLINE is set. The \fB/8\fR modifier causes \fBpcretest\fR to call PCRE with the PCRE_UTF8 option set. This turns on support for UTF-8 character handling in PCRE, provided that it was compiled with this support enabled. This modifier also causes any non-printing characters in output strings to be printed using the \\x{hh...} notation if they are valid UTF-8 sequences. If the \fB/?\fR modifier is used with \fB/8\fR, it causes \fBpcretest\fR to call \fBpcre_compile()\fR with the PCRE_NO_UTF8_CHECK option, to suppress the checking of the string for UTF-8 validity. .SH CALLOUTS .rs .sp If the pattern contains any callout requests, \fBpcretest\fR's callout function will be called. By default, it displays the callout number, and the start and current positions in the text at the callout time. For example, the output --->pqrabcdef 0 ^ ^ indicates that callout number 0 occurred for a match attempt starting at the fourth character of the subject string, when the pointer was at the seventh character. The callout function returns zero (carry on matching) by default. Inserting callouts may be helpful when using \fBpcretest\fR to check complicated regular expressions. For further information about callouts, see the .\" HREF \fBpcrecallout\fR .\" documentation. For testing the PCRE library, additional control of callout behaviour is available via escape sequences in the data, as described in the following section. In particular, it is possible to pass in a number as callout data (the default is zero). If the callout function receives a non-zero number, it returns that value instead of zero. .SH DATA LINES .rs .sp Before each data line is passed to \fBpcre_exec()\fR, leading and trailing whitespace is removed, and it is then scanned for \\ escapes. Some of these are pretty esoteric features, intended for checking out some of the more complicated features of PCRE. If you are just testing "ordinary" regular expressions, you probably don't need any of these. The following escapes are recognized: \\a alarm (= BEL) \\b backspace \\e escape \\f formfeed \\n newline \\r carriage return \\t tab \\v vertical tab \\nnn octal character (up to 3 octal digits) \\xhh hexadecimal character (up to 2 hex digits) \\x{hh...} hexadecimal character, any number of digits in UTF-8 mode \\A pass the PCRE_ANCHORED option to \fBpcre_exec()\fR \\B pass the PCRE_NOTBOL option to \fBpcre_exec()\fR \\Cdd call pcre_copy_substring() for substring dd after a successful match (any decimal number less than 32) \\Cname call pcre_copy_named_substring() for substring "name" after a successful match (name termin- ated by next non alphanumeric character) \\C+ show the current captured substrings at callout time \\C- do not supply a callout function \\C!n return 1 instead of 0 when callout number n is reached \\C!n!m return 1 instead of 0 when callout number n is reached for the nth time \\C*n pass the number n (may be negative) as callout data \\Gdd call pcre_get_substring() for substring dd after a successful match (any decimal number less than 32) \\Gname call pcre_get_named_substring() for substring "name" after a successful match (name termin- ated by next non-alphanumeric character) \\L call pcre_get_substringlist() after a successful match \\M discover the minimum MATCH_LIMIT setting \\N pass the PCRE_NOTEMPTY option to \fBpcre_exec()\fR \\Odd set the size of the output vector passed to \fBpcre_exec()\fR to dd (any number of decimal digits) \\S output details of memory get/free calls during matching \\Z pass the PCRE_NOTEOL option to \fBpcre_exec()\fR \\? pass the PCRE_NO_UTF8_CHECK option to \fBpcre_exec()\fR If \\M is present, \fBpcretest\fR calls \fBpcre_exec()\fR several times, with different values in the \fImatch_limit\fR field of the \fBpcre_extra\fR data structure, until it finds the minimum number that is needed for \fBpcre_exec()\fR to complete. This number is a measure of the amount of recursion and backtracking that takes place, and checking it out can be instructive. For most simple matches, the number is quite small, but for patterns with very large numbers of matching possibilities, it can become large very quickly with increasing length of subject string. When \\O is used, it may be higher or lower than the size set by the \fB-O\fR option (or defaulted to 45); \\O applies only to the call of \fBpcre_exec()\fR for the line in which it appears. A backslash followed by anything else just escapes the anything else. If the very last character is a backslash, it is ignored. This gives a way of passing an empty line as data, since a real empty line terminates the data input. If \fB/P\fR was present on the regex, causing the POSIX wrapper API to be used, only \fB\B\fR, and \fB\Z\fR have any effect, causing REG_NOTBOL and REG_NOTEOL to be passed to \fBregexec()\fR respectively. The use of \\x{hh...} to represent UTF-8 characters is not dependent on the use of the \fB/8\fR modifier on the pattern. It is recognized always. There may be any number of hexadecimal digits inside the braces. The result is from one to six bytes, encoded according to the UTF-8 rules. .SH OUTPUT FROM PCRETEST .rs .sp When a match succeeds, pcretest outputs the list of captured substrings that \fBpcre_exec()\fR returns, starting with number 0 for the string that matched the whole pattern. Here is an example of an interactive pcretest run. $ pcretest PCRE version 4.00 08-Jan-2003 re> /^abc(\\d+)/ data> abc123 0: abc123 1: 123 data> xyz No match If the strings contain any non-printing characters, they are output as \\0x escapes, or as \\x{...} escapes if the \fB/8\fR modifier was present on the pattern. If the pattern has the \fB/+\fR modifier, then the output for substring 0 is followed by the the rest of the subject string, identified by "0+" like this: re> /cat/+ data> cataract 0: cat 0+ aract If the pattern has the \fB/g\fR or \fB/G\fR modifier, the results of successive matching attempts are output in sequence, like this: re> /\\Bi(\\w\\w)/g data> Mississippi 0: iss 1: ss 0: iss 1: ss 0: ipp 1: pp "No match" is output only if the first match attempt fails. If any of the sequences \fB\\C\fR, \fB\\G\fR, or \fB\\L\fR are present in a data line that is successfully matched, the substrings extracted by the convenience functions are output with C, G, or L after the string number instead of a colon. This is in addition to the normal full list. The string length (that is, the return from the extraction function) is given in parentheses after each string for \fB\\C\fR and \fB\\G\fR. Note that while patterns can be continued over several lines (a plain ">" prompt is used for continuations), data lines may not. However newlines can be included in data by means of the \\n escape. .SH AUTHOR .rs .sp Philip Hazel .br University Computing Service, .br Cambridge CB2 3QG, England. .in 0 Last updated: 09 December 2003 .br Copyright (c) 1997-2003 University of Cambridge. 0707010001456f000081a40000000a0000000a00000001402cbd65000041620000008800000005000000000000000000000020ff350892reloc/doc/pcre/doc/pcretest.txtPCRETEST(1) PCRETEST(1) NAME pcretest - a program for testing Perl-compatible regular expressions. SYNOPSIS pcretest [-d] [-i] [-m] [-o osize] [-p] [-t] [source] [destination] pcretest was written as a test program for the PCRE regular expression library itself, but it can also be used for experimenting with regular expressions. This document describes the features of the test program; for details of the regular expressions themselves, see the pcrepattern documentation. For details of PCRE and its options, see the pcreapi documentation. OPTIONS -C Output the version number of the PCRE library, and all avail- able information about the optional features that are included, and then exit. -d Behave as if each regex had the /D modifier (see below); the internal form is output after compilation. -i Behave as if each regex had the /I modifier; information about the compiled pattern is given after compilation. -m Output the size of each compiled pattern after it has been compiled. This is equivalent to adding /M to each regular expression. For compatibility with earlier versions of pcretest, -s is a synonym for -m. -o osize Set the number of elements in the output vector that is used when calling PCRE to be osize. The default value is 45, which is enough for 14 capturing subexpressions. The vector size can be changed for individual matching calls by including \O in the data line (see below). -p Behave as if each regex has /P modifier; the POSIX wrapper API is used to call PCRE. None of the other options has any effect when -p is set. -t Run each compile, study, and match many times with a timer, and output resulting time per compile or match (in millisec- onds). Do not set -t with -m, because you will then get the size output 20000 times and the timing will be distorted. DESCRIPTION If pcretest is given two filename arguments, it reads from the first and writes to the second. If it is given only one filename argument, it reads from that file and writes to stdout. Otherwise, it reads from stdin and writes to stdout, and prompts for each line of input, using "re>" to prompt for regular expressions, and "data>" to prompt for data lines. The program handles any number of sets of input on a single input file. Each set starts with a regular expression, and continues with any num- ber of data lines to be matched against the pattern. Each line is matched separately and independently. If you want to do multiple-line matches, you have to use the \n escape sequence in a sin- gle line of input to encode the newline characters. The maximum length of data line is 30,000 characters. An empty line signals the end of the data lines, at which point a new regular expression is read. The regular expressions are given enclosed in any non-alphameric delimiters other than backslash, for example /(a|bc)x+yz/ White space before the initial delimiter is ignored. A regular expres- sion may be continued over several input lines, in which case the new- line characters are included within it. It is possible to include the delimiter within the pattern by escaping it, for example /abc\/def/ If you do so, the escape and the delimiter form part of the pattern, but since delimiters are always non-alphameric, this does not affect its interpretation. If the terminating delimiter is immediately fol- lowed by a backslash, for example, /abc/\ then a backslash is added to the end of the pattern. This is done to provide a way of testing the error condition that arises if a pattern finishes with a backslash, because /abc\/ is interpreted as the first line of a pattern that starts with "abc/", causing pcretest to read the next line as a continuation of the regular expression. PATTERN MODIFIERS The pattern may be followed by i, m, s, or x to set the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, or PCRE_EXTENDED options, respectively. For example: /caseless/i These modifier letters have the same effect as they do in Perl. There are others that set PCRE options that do not correspond to anything in Perl: /A, /E, /N, /U, and /X set PCRE_ANCHORED, PCRE_DOLLAR_ENDONLY, PCRE_NO_AUTO_CAPTURE, PCRE_UNGREEDY, and PCRE_EXTRA respectively. Searching for all possible matches within each subject string can be requested by the /g or /G modifier. After finding a match, PCRE is called again to search the remainder of the subject string. The differ- ence between /g and /G is that the former uses the startoffset argument to pcre_exec() to start searching at a new point within the entire string (which is in effect what Perl does), whereas the latter passes over a shortened substring. This makes a difference to the matching process if the pattern begins with a lookbehind assertion (including \b or \B). If any call to pcre_exec() in a /g or /G sequence matches an empty string, the next call is done with the PCRE_NOTEMPTY and PCRE_ANCHORED flags set in order to search for another, non-empty, match at the same point. If this second match fails, the start offset is advanced by one, and the normal match is retried. This imitates the way Perl han- dles such cases when using the /g modifier or the split() function. There are a number of other modifiers for controlling the way pcretest operates. The /+ modifier requests that as well as outputting the substring that matched the entire pattern, pcretest should in addition output the remainder of the subject string. This is useful for tests where the subject contains multiple copies of the same substring. The /L modifier must be followed directly by the name of a locale, for example, /pattern/Lfr For this reason, it must be the last modifier letter. The given locale is set, pcre_maketables() is called to build a set of character tables for the locale, and this is then passed to pcre_compile() when compil- ing the regular expression. Without an /L modifier, NULL is passed as the tables pointer; that is, /L applies only to the expression on which it appears. The /I modifier requests that pcretest output information about the compiled expression (whether it is anchored, has a fixed first charac- ter, and so on). It does this by calling pcre_fullinfo() after compil- ing an expression, and outputting the information it gets back. If the pattern is studied, the results of that are also output. The /D modifier is a PCRE debugging feature, which also assumes /I. It causes the internal form of compiled regular expressions to be output after compilation. If the pattern was studied, the information returned is also output. The /S modifier causes pcre_study() to be called after the expression has been compiled, and the results used when the expression is matched. The /M modifier causes the size of memory block used to hold the com- piled pattern to be output. The /P modifier causes pcretest to call PCRE via the POSIX wrapper API rather than its native API. When this is done, all other modifiers except /i, /m, and /+ are ignored. REG_ICASE is set if /i is present, and REG_NEWLINE is set if /m is present. The wrapper functions force PCRE_DOLLAR_ENDONLY always, and PCRE_DOTALL unless REG_NEWLINE is set. The /8 modifier causes pcretest to call PCRE with the PCRE_UTF8 option set. This turns on support for UTF-8 character handling in PCRE, pro- vided that it was compiled with this support enabled. This modifier also causes any non-printing characters in output strings to be printed using the \x{hh...} notation if they are valid UTF-8 sequences. If the /? modifier is used with /8, it causes pcretest to call pcre_compile() with the PCRE_NO_UTF8_CHECK option, to suppress the checking of the string for UTF-8 validity. CALLOUTS If the pattern contains any callout requests, pcretest's callout func- tion will be called. By default, it displays the callout number, and the start and current positions in the text at the callout time. For example, the output --->pqrabcdef 0 ^ ^ indicates that callout number 0 occurred for a match attempt starting at the fourth character of the subject string, when the pointer was at the seventh character. The callout function returns zero (carry on matching) by default. Inserting callouts may be helpful when using pcretest to check compli- cated regular expressions. For further information about callouts, see the pcrecallout documentation. For testing the PCRE library, additional control of callout behaviour is available via escape sequences in the data, as described in the fol- lowing section. In particular, it is possible to pass in a number as callout data (the default is zero). If the callout function receives a non-zero number, it returns that value instead of zero. DATA LINES Before each data line is passed to pcre_exec(), leading and trailing whitespace is removed, and it is then scanned for \ escapes. Some of these are pretty esoteric features, intended for checking out some of the more complicated features of PCRE. If you are just testing "ordi- nary" regular expressions, you probably don't need any of these. The following escapes are recognized: \a alarm (= BEL) \b backspace \e escape \f formfeed \n newline \r carriage return \t tab \v vertical tab \nnn octal character (up to 3 octal digits) \xhh hexadecimal character (up to 2 hex digits) \x{hh...} hexadecimal character, any number of digits in UTF-8 mode \A pass the PCRE_ANCHORED option to pcre_exec() \B pass the PCRE_NOTBOL option to pcre_exec() \Cdd call pcre_copy_substring() for substring dd after a successful match (any decimal number less than 32) \Cname call pcre_copy_named_substring() for substring "name" after a successful match (name termin- ated by next non alphanumeric character) \C+ show the current captured substrings at callout time \C- do not supply a callout function \C!n return 1 instead of 0 when callout number n is reached \C!n!m return 1 instead of 0 when callout number n is reached for the nth time \C*n pass the number n (may be negative) as callout data \Gdd call pcre_get_substring() for substring dd after a successful match (any decimal number less than 32) \Gname call pcre_get_named_substring() for substring "name" after a successful match (name termin- ated by next non-alphanumeric character) \L call pcre_get_substringlist() after a successful match \M discover the minimum MATCH_LIMIT setting \N pass the PCRE_NOTEMPTY option to pcre_exec() \Odd set the size of the output vector passed to pcre_exec() to dd (any number of decimal digits) \S output details of memory get/free calls during matching \Z pass the PCRE_NOTEOL option to pcre_exec() \? pass the PCRE_NO_UTF8_CHECK option to pcre_exec() If \M is present, pcretest calls pcre_exec() several times, with dif- ferent values in the match_limit field of the pcre_extra data struc- ture, until it finds the minimum number that is needed for pcre_exec() to complete. This number is a measure of the amount of recursion and backtracking that takes place, and checking it out can be instructive. For most simple matches, the number is quite small, but for patterns with very large numbers of matching possibilities, it can become large very quickly with increasing length of subject string. When \O is used, it may be higher or lower than the size set by the -O option (or defaulted to 45); \O applies only to the call of pcre_exec() for the line in which it appears. A backslash followed by anything else just escapes the anything else. If the very last character is a backslash, it is ignored. This gives a way of passing an empty line as data, since a real empty line termi- nates the data input. If /P was present on the regex, causing the POSIX wrapper API to be used, only 0 causing REG_NOTBOL and REG_NOTEOL to be passed to regexec() respectively. The use of \x{hh...} to represent UTF-8 characters is not dependent on the use of the /8 modifier on the pattern. It is recognized always. There may be any number of hexadecimal digits inside the braces. The result is from one to six bytes, encoded according to the UTF-8 rules. OUTPUT FROM PCRETEST When a match succeeds, pcretest outputs the list of captured substrings that pcre_exec() returns, starting with number 0 for the string that matched the whole pattern. Here is an example of an interactive pcretest run. $ pcretest PCRE version 4.00 08-Jan-2003 re> /^abc(\d+)/ data> abc123 0: abc123 1: 123 data> xyz No match If the strings contain any non-printing characters, they are output as \0x escapes, or as \x{...} escapes if the /8 modifier was present on the pattern. If the pattern has the /+ modifier, then the output for substring 0 is followed by the the rest of the subject string, identi- fied by "0+" like this: re> /cat/+ data> cataract 0: cat 0+ aract If the pattern has the /g or /G modifier, the results of successive matching attempts are output in sequence, like this: re> /\Bi(\w\w)/g data> Mississippi 0: iss 1: ss 0: iss 1: ss 0: ipp 1: pp "No match" is output only if the first match attempt fails. If any of the sequences \C, \G, or \L are present in a data line that is successfully matched, the substrings extracted by the convenience functions are output with C, G, or L after the string number instead of a colon. This is in addition to the normal full list. The string length (that is, the return from the extraction function) is given in paren- theses after each string for \C and \G. Note that while patterns can be continued over several lines (a plain ">" prompt is used for continuations), data lines may not. However new- lines can be included in data by means of the \n escape. AUTHOR Philip Hazel University Computing Service, Cambridge CB2 3QG, England. Last updated: 09 December 2003 Copyright (c) 1997-2003 University of Cambridge. 07070100014570000081a40000000a0000000a00000001402cbd65000006aa0000008800000005000000000000000000000020ff350892reloc/doc/pcre/doc/perltest.txtThe perltest program -------------------- The perltest program tests Perl's regular expressions; it has the same specification as pcretest, and so can be given identical input, except that input patterns can be followed only by Perl's lower case modifiers and /+ (as used by pcretest), which is recognized and handled by the program. The data lines are processed as Perl double-quoted strings, so if they contain " \ $ or @ characters, these have to be escaped. For this reason, all such characters in testinput1 and testinput3 are escaped so that they can be used for perltest as well as for pcretest, and the special upper case modifiers such as /A that pcretest recognizes are not used in these files. The output should be identical, apart from the initial identifying banner. The perltest script can also test UTF-8 features. It works as is for Perl 5.8 or higher. It recognizes the special modifier /8 that pcretest uses to invoke UTF-8 functionality. The testinput5 file can be fed to perltest to run UTF-8 tests. For Perl 5.6, perltest won't work unmodified for the UTF-8 tests. You need to uncomment the "use utf8" lines that it contains. It is best to do this on a copy of the script, because for non-UTF-8 tests, these lines should remain commented out. The testinput2 and testinput4 files are not suitable for feeding to perltest, since they do make use of the special upper case modifiers and escapes that pcretest uses to test some features of PCRE. The first of these files also contains malformed regular expressions, in order to check that PCRE diagnoses them correctly. Similarly, testinput6 tests UTF-8 features that do not relate to Perl. Philip Hazel August 2002 07070100004a35000041ed0000000a0000000a00000002402cbe2300000000000000880000000500000000000000000000000eff350892reloc/include07070100004a36000081a40000000a0000000a00000001402cbcbd00001b7e0000008800000005000000000000000000000015ff35088dreloc/include/pcre.h/************************************************* * Perl-Compatible Regular Expressions * *************************************************/ /* Copyright (c) 1997-2003 University of Cambridge */ #ifndef _PCRE_H #define _PCRE_H /* The file pcre.h is build by "configure". Do not edit it; instead make changes to pcre.in. */ #define PCRE_MAJOR 4 #define PCRE_MINOR 5 #define PCRE_DATE 01-December-2003 /* Win32 uses DLL by default */ #ifdef _WIN32 # ifdef PCRE_DEFINITION # ifdef DLL_EXPORT # define PCRE_DATA_SCOPE __declspec(dllexport) # endif # else # ifndef PCRE_STATIC # define PCRE_DATA_SCOPE extern __declspec(dllimport) # endif # endif #endif #ifndef PCRE_DATA_SCOPE # define PCRE_DATA_SCOPE extern #endif /* Have to include stdlib.h in order to ensure that size_t is defined; it is needed here for malloc. */ #include /* Allow for C++ users */ #ifdef __cplusplus extern "C" { #endif /* Options */ #define PCRE_CASELESS 0x0001 #define PCRE_MULTILINE 0x0002 #define PCRE_DOTALL 0x0004 #define PCRE_EXTENDED 0x0008 #define PCRE_ANCHORED 0x0010 #define PCRE_DOLLAR_ENDONLY 0x0020 #define PCRE_EXTRA 0x0040 #define PCRE_NOTBOL 0x0080 #define PCRE_NOTEOL 0x0100 #define PCRE_UNGREEDY 0x0200 #define PCRE_NOTEMPTY 0x0400 #define PCRE_UTF8 0x0800 #define PCRE_NO_AUTO_CAPTURE 0x1000 #define PCRE_NO_UTF8_CHECK 0x2000 /* Exec-time and get/set-time error codes */ #define PCRE_ERROR_NOMATCH (-1) #define PCRE_ERROR_NULL (-2) #define PCRE_ERROR_BADOPTION (-3) #define PCRE_ERROR_BADMAGIC (-4) #define PCRE_ERROR_UNKNOWN_NODE (-5) #define PCRE_ERROR_NOMEMORY (-6) #define PCRE_ERROR_NOSUBSTRING (-7) #define PCRE_ERROR_MATCHLIMIT (-8) #define PCRE_ERROR_CALLOUT (-9) /* Never used by PCRE itself */ #define PCRE_ERROR_BADUTF8 (-10) #define PCRE_ERROR_BADUTF8_OFFSET (-11) /* Request types for pcre_fullinfo() */ #define PCRE_INFO_OPTIONS 0 #define PCRE_INFO_SIZE 1 #define PCRE_INFO_CAPTURECOUNT 2 #define PCRE_INFO_BACKREFMAX 3 #define PCRE_INFO_FIRSTBYTE 4 #define PCRE_INFO_FIRSTCHAR 4 /* For backwards compatibility */ #define PCRE_INFO_FIRSTTABLE 5 #define PCRE_INFO_LASTLITERAL 6 #define PCRE_INFO_NAMEENTRYSIZE 7 #define PCRE_INFO_NAMECOUNT 8 #define PCRE_INFO_NAMETABLE 9 #define PCRE_INFO_STUDYSIZE 10 /* Request types for pcre_config() */ #define PCRE_CONFIG_UTF8 0 #define PCRE_CONFIG_NEWLINE 1 #define PCRE_CONFIG_LINK_SIZE 2 #define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3 #define PCRE_CONFIG_MATCH_LIMIT 4 #define PCRE_CONFIG_STACKRECURSE 5 /* Bit flags for the pcre_extra structure */ #define PCRE_EXTRA_STUDY_DATA 0x0001 #define PCRE_EXTRA_MATCH_LIMIT 0x0002 #define PCRE_EXTRA_CALLOUT_DATA 0x0004 /* Types */ struct real_pcre; /* declaration; the definition is private */ typedef struct real_pcre pcre; /* The structure for passing additional data to pcre_exec(). This is defined in such as way as to be extensible. */ typedef struct pcre_extra { unsigned long int flags; /* Bits for which fields are set */ void *study_data; /* Opaque data from pcre_study() */ unsigned long int match_limit; /* Maximum number of calls to match() */ void *callout_data; /* Data passed back in callouts */ } pcre_extra; /* The structure for passing out data via the pcre_callout_function. We use a structure so that new fields can be added on the end in future versions, without changing the API of the function, thereby allowing old clients to work without modification. */ typedef struct pcre_callout_block { int version; /* Identifies version of block */ /* ------------------------ Version 0 ------------------------------- */ int callout_number; /* Number compiled into pattern */ int *offset_vector; /* The offset vector */ const char *subject; /* The subject being matched */ int subject_length; /* The length of the subject */ int start_match; /* Offset to start of this match attempt */ int current_position; /* Where we currently are */ int capture_top; /* Max current capture */ int capture_last; /* Most recently closed capture */ void *callout_data; /* Data passed in with the call */ /* ------------------------------------------------------------------ */ } pcre_callout_block; /* Indirection for store get and free functions. These can be set to alternative malloc/free functions if required. Special ones are used in the non-recursive case for "frames". There is also an optional callout function that is triggered by the (?) regex item. Some magic is required for Win32 DLL; it is null on other OS. For Virtual Pascal, these have to be different again. */ #ifndef VPCOMPAT PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t); PCRE_DATA_SCOPE void (*pcre_free)(void *); PCRE_DATA_SCOPE void *(*pcre_stack_malloc)(size_t); PCRE_DATA_SCOPE void (*pcre_stack_free)(void *); PCRE_DATA_SCOPE int (*pcre_callout)(pcre_callout_block *); #else /* VPCOMPAT */ extern void *pcre_malloc(size_t); extern void pcre_free(void *); extern void *pcre_stack_malloc(size_t); extern void pcre_stack_free(void *); extern int pcre_callout(pcre_callout_block *); #endif /* VPCOMPAT */ /* Exported PCRE functions */ extern pcre *pcre_compile(const char *, int, const char **, int *, const unsigned char *); extern int pcre_config(int, void *); extern int pcre_copy_named_substring(const pcre *, const char *, int *, int, const char *, char *, int); extern int pcre_copy_substring(const char *, int *, int, int, char *, int); extern int pcre_exec(const pcre *, const pcre_extra *, const char *, int, int, int, int *, int); extern void pcre_free_substring(const char *); extern void pcre_free_substring_list(const char **); extern int pcre_fullinfo(const pcre *, const pcre_extra *, int, void *); extern int pcre_get_named_substring(const pcre *, const char *, int *, int, const char *, const char **); extern int pcre_get_stringnumber(const pcre *, const char *); extern int pcre_get_substring(const char *, int *, int, int, const char **); extern int pcre_get_substring_list(const char *, int *, int, const char ***); extern int pcre_info(const pcre *, int *, int *); extern const unsigned char *pcre_maketables(void); extern pcre_extra *pcre_study(const pcre *, int, const char **); extern const char *pcre_version(void); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* End of pcre.h */ 07070100004a37000081a40000000a0000000a00000001402cbcbd0000092b000000880000000500000000000000000000001aff35088dreloc/include/pcreposix.h/************************************************* * Perl-Compatible Regular Expressions * *************************************************/ /* Copyright (c) 1997-2003 University of Cambridge */ #ifndef _PCREPOSIX_H #define _PCREPOSIX_H /* This is the header for the POSIX wrapper interface to the PCRE Perl- Compatible Regular Expression library. It defines the things POSIX says should be there. I hope. */ /* Have to include stdlib.h in order to ensure that size_t is defined. */ #include /* Allow for C++ users */ #ifdef __cplusplus extern "C" { #endif /* Options defined by POSIX. */ #define REG_ICASE 0x01 #define REG_NEWLINE 0x02 #define REG_NOTBOL 0x04 #define REG_NOTEOL 0x08 /* These are not used by PCRE, but by defining them we make it easier to slot PCRE into existing programs that make POSIX calls. */ #define REG_EXTENDED 0 #define REG_NOSUB 0 /* Error values. Not all these are relevant or used by the wrapper. */ enum { REG_ASSERT = 1, /* internal error ? */ REG_BADBR, /* invalid repeat counts in {} */ REG_BADPAT, /* pattern error */ REG_BADRPT, /* ? * + invalid */ REG_EBRACE, /* unbalanced {} */ REG_EBRACK, /* unbalanced [] */ REG_ECOLLATE, /* collation error - not relevant */ REG_ECTYPE, /* bad class */ REG_EESCAPE, /* bad escape sequence */ REG_EMPTY, /* empty expression */ REG_EPAREN, /* unbalanced () */ REG_ERANGE, /* bad range inside [] */ REG_ESIZE, /* expression too big */ REG_ESPACE, /* failed to get memory */ REG_ESUBREG, /* bad back reference */ REG_INVARG, /* bad argument */ REG_NOMATCH /* match failed */ }; /* The structure representing a compiled regular expression. */ typedef struct { void *re_pcre; size_t re_nsub; size_t re_erroffset; } regex_t; /* The structure in which a captured offset is returned. */ typedef int regoff_t; typedef struct { regoff_t rm_so; regoff_t rm_eo; } regmatch_t; /* The functions */ extern int regcomp(regex_t *, const char *, int); extern int regexec(const regex_t *, const char *, size_t, regmatch_t *, int); extern size_t regerror(int, const regex_t *, char *, size_t); extern void regfree(regex_t *); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* End of pcreposix.h */ 0707010000590f000041ed0000000a0000000a00000002402cbe2400000000000000880000000500000000000000000000000aff35088dreloc/lib07070100005910000081a40000000a0000000a00000001402cbcba000233dc0000008800000005000000000000000000000014ff350889reloc/lib/libpcre.a! / 1076671888 0 0 0 440 ` --------d pcre_maketablespcre_free_substringpcre_get_named_substringpcre_free_substring_listpcre_get_substringpcre_get_substring_listpcre_get_stringnumberpcre_copy_named_substringpcre_copy_substringpcre_studypcre_compilepcre_configpcre_execpcre_versionpcre_infopcre_stack_mallocpcre_fullinfopcre_freepcre_calloutpcre_stack_freepcre_mallocmaketables.o/ 1076671860 10 10 100644 11088 ` ELF)4( .shstrtab.text.rodata.stab.stabstr.symtab.strtab.rela.text.rela.stab.comment㿐`$@@ @ ,@ `!` `΢`@  , !@@ `   ``> 0`8`@`@` *@   (`(`@ ``> 0`8`@``` *@   (`(`` ` _> 0`8`@`` *@   (`(`"  ` `> 0`8` @ *@  ,@ `2j> ``W> 0`8`@` *@  (` `W`> 0`8`@` *@  (` `` > 0`8`@a *@  (a ` "  > 0`8`@a  *@  (a   $ a@` '  `2  ``2 `2 `2 ` _@ `? 2 @ 2 ,@  ܢ`0`8`@`  *@  (`  {* @5 *+?{^.$|()[d)d6<EoY 5dtʀ!Afǂ܂6y݂&DE+؂+9UPEւ5Pqׂ  ۀ; K X i 3q J{ b x À< A 6G rO m Uw o ƀ ؀yÀ؀-h5F̀N1Zz$?D?DDDDDIDN$DRDDNHDRLDYDRDYDZD\D^D_D^D_D^D_D^D_DaDcDdDcDd Dc$Dd(Dc,Dd0Df4Dh@DiXDh\DidDhhDilDhpDktDl|DmDnDoDp0DqhDZDyDsDyD|D|D}D~DDD,DyHDyLDXD@@@@@A@{H@{PX$dmaketables.c/usr2/SOURCES/S9/pcre-4.5/maketables.cgcc2_compiled.int:t(0,1)=r(0,1);-2147483648;2147483647;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,3);-2147483648;2147483647;unsigned int:t(0,4)=r(0,4);000000000000000000000000;000000000000037777777777;long unsigned int:t(0,5)=r(0,5);000000000000000000000000;000000000000037777777777;long long int:t(0,6)=@s64;r(0,6);001000000000000000000000;000777777777777777777777;long long unsigned int:t(0,7)=@s64;r(0,7);000000000000000000000000;001777777777777777777777;short int:t(0,8)=@s16;r(0,8);-32768;32767;short unsigned int:t(0,9)=@s16;r(0,9);0;65535;signed char:t(0,10)=@s8;r(0,10);-128;127;unsigned char:t(0,11)=@s8;r(0,11);0;255;__int128_t:t(0,12)=@s128;r(0,12);000000000000000000000000;0377777777777777777777777777777777;__uint128_t:t(0,13)=@s128;r(0,13);000000000000000000000000;0377777777777777777777777777777777;float:t(0,14)=r(0,1);4;0;double:t(0,15)=r(0,1);8;0;long double:t(0,16)=r(0,1);16;0;complex int:t(0,17)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,18)=R3;8;0;complex double:t(0,19)=R4;16;0;complex long double:t(0,20)=R5;32;0;__builtin_va_list:t(0,21)=*(0,22)=(0,22)_Bool:t(0,23)=@s8;-16;maketables.cinternal.hconfig.h/usr/include/ctype.h/usr/include/iso/ctype_iso.h/usr/include/sys/feature_tests.h/usr/include/sys/isa_defs.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/limits.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/syslimits.h/usr/include/iso/limits_iso.h/usr/include/sys/int_limits.hclock_t:t(9,1)=(0,3)/usr/include/setjmp.h/usr/include/iso/setjmp_iso.hjmp_buf:t(13,1)=(13,2)=ar(13,3)=r(13,3);000000000000000000000000;000000000000037777777777;;0;11;(0,1)sigjmp_buf:t(12,1)=(12,2)=ar(13,3);0;18;(0,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdarg.h__gnuc_va_list:t(14,1)=(0,21)va_list:t(14,2)=(14,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stddef.hptrdiff_t:t(15,1)=(0,1)size_t:t(15,2)=(0,4)wchar_t:t(15,3)=(0,3)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio.h/usr/include/iso/stdio_iso.h/usr/include/sys/va_list.h__va_list:t(18,1)=(18,2)=*(0,22)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio_tag.h__FILE:t(19,1)=(19,2)=xs__FILE:/usr/include/stdio_impl.hssize_t:t(20,1)=(0,1)__FILE:T(19,2)=s16_cnt:(20,1),0,32;_ptr:(20,2)=*(0,11),32,32;_base:(20,2),64,32;_flag:(0,11),96,8;_file:(0,11),104,8;__orientation:(0,4),112,2;__ionolock:(0,4),114,1;__seekable:(0,4),115,1;__filler:(0,4),116,4;;__longlong_t:t(17,1)=(0,6)FILE:t(17,2)=(19,1)fpos_t:t(17,3)=(0,3)off_t:t(16,1)=(0,3)off64_t:t(16,2)=(17,1)fpos64_t:t(16,3)=(17,1)/usr/include/stdlib.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/iso/stdlib_iso.hdiv_t:t(22,1)=(22,2)=s8quot:(0,1),0,32;rem:(0,1),32,32;;ldiv_t:t(22,3)=(22,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;lldiv_t:t(21,1)=(21,2)=s16quot:(0,6),0,64;rem:(0,6),64,64;;uid_t:t(21,3)=(0,3)/usr/include/string.h/usr/include/iso/string_iso.hpcre.hpcre:t(25,1)=(25,2)=xsreal_pcre:pcre_extra:T(25,3)=s16flags:(0,5),0,32;study_data:(18,2),32,32;match_limit:(0,5),64,32;callout_data:(18,2),96,32;;pcre_extra:t(25,4)=(25,3)pcre_callout_block:T(25,5)=s40version:(0,1),0,32;callout_number:(0,1),32,32;offset_vector:(25,6)=*(0,1),64,32;subject:(25,7)=*(25,8)=k(0,2),96,32;subject_length:(0,1),128,32;start_match:(0,1),160,32;current_position:(0,1),192,32;capture_top:(0,1),224,32;capture_last:(0,1),256,32;callout_data:(18,2),288,32;;pcre_callout_block:t(25,9)=(25,5)BOOL:t(2,1)=(0,1) :T(2,2)=eESC_A:1,ESC_G:2,ESC_B:3,ESC_b:4,ESC_D:5,ESC_d:6,ESC_S:7,ESC_s:8,ESC_W:9,ESC_w:10,ESC_dum1:11,ESC_C:12,ESC_Z:13,ESC_z:14,ESC_E:15,ESC_Q:16,ESC_REF:17,; :T(2,3)=eOP_END:0,OP_SOD:1,OP_SOM:2,OP_NOT_WORD_BOUNDARY:3,OP_WORD_BOUNDARY:4,OP_NOT_DIGIT:5,OP_DIGIT:6,OP_NOT_WHITESPACE:7,OP_WHITESPACE:8,OP_NOT_WORDCHAR:9,OP_WORDCHAR:10,OP_ANY:11,OP_ANYBYTE:12,OP_EODN:13,OP_EOD:14,OP_OPT:15,OP_CIRC:16,OP_DOLL:17,OP_CHARS:18,OP_NOT:19,OP_STAR:20,OP_MINSTAR:21,OP_PLUS:22,OP_MINPLUS:23,OP_QUERY:24,OP_MINQUERY:25,OP_UPTO:26,OP_MINUPTO:27,OP_EXACT:28,OP_NOTSTAR:29,OP_NOTMINSTAR:30,OP_NOTPLUS:31,OP_NOTMINPLUS:32,OP_NOTQUERY:33,OP_NOTMINQUERY:34,OP_NOTUPTO:35,OP_NOTMINUPTO:36,OP_NOTEXACT:37,OP_TYPESTAR:38,OP_TYPEMINSTAR:39,OP_TYPEPLUS:40,OP_TYPEMINPLUS:41,OP_TYPEQUERY:42,OP_TYPEMINQUERY:43,OP_TYPEUPTO:44,OP_TYPEMINUPTO:45,OP_TYPEEXACT:46,OP_CRSTAR:47,OP_CRMINSTAR:48,OP_CRPLUS:49,OP_CRMINPLUS:50,OP_CRQUERY:51,OP_CRMINQUERY:52,OP_CRRANGE:53,OP_CRMINRANGE:54,OP_CLASS:55,OP_NCLASS:56,OP_XCLASS:57,OP_REF:58,OP_RECURSE:59,OP_CALLOUT:60,OP_ALT:61,OP_KET:62,OP_KETRMAX:63,OP_KETRMIN:64,OP_ASSERT:65,OP_ASSERT_NOT:66,OP_ASSERTBACK:67,OP_ASSERTBACK_NOT:68,OP_REVERSE:69,OP_ONCE:70,OP_COND:71,OP_CREF:72,OP_BRAZERO:73,OP_BRAMINZERO:74,\OP_BRANUMBER:75,OP_BRA:76,;uschar:t(2,4)=(0,11)real_pcre:T(25,2)=s28magic_number:(0,5),0,32;size:(15,2),32,32;tables:(2,5)=*(2,6)=k(0,11),64,32;options:(0,5),96,32;top_bracket:(0,9),128,16;top_backref:(0,9),144,16;first_byte:(0,9),160,16;req_byte:(0,9),176,16;name_entry_size:(0,9),192,16;name_count:(0,9),208,16;;real_pcre:t(2,7)=(25,2)pcre_study_data:T(2,8)=s40size:(15,2),0,32;options:(2,4),32,8;start_bits:(2,9)=ar(13,3);0;31;(2,4),40,256;;pcre_study_data:t(2,10)=(2,8)compile_data:T(2,11)=s44lcc:(2,12)=*(2,13)=k(2,4),0,32;fcc:(2,12),32,32;cbits:(2,12),64,32;ctypes:(2,12),96,32;start_code:(2,12),128,32;name_table:(2,14)=*(2,4),160,32;names_found:(0,1),192,32;name_entry_size:(0,1),224,32;top_backref:(0,1),256,32;backref_map:(0,4),288,32;req_varyopt:(0,1),320,32;;compile_data:t(2,15)=(2,11)branch_chain:T(2,16)=s8outer:(2,17)=*(2,16),0,32;current:(2,14),32,32;;branch_chain:t(2,18)=(2,16)recursion_info:T(2,19)=s24prevrec:(2,20)=*(2,19),0,32;group_num:(0,1),32,32;after_call:(2,12),64,32;save_start:(2,12),96,32;offset_save:(25,6),128,32;saved_max:(0,1),160,32;;recursion_info:t(2,21)=(2,19)match_data:T(2,22)=s96match_call_count:(0,5),0,32;match_limit:(0,5),32,32;offset_vector:(25,6),64,32;offset_end:(0,1),96,32;offset_max:(0,1),128,32;lcc:(2,12),160,32;ctypes:(2,12),192,32;offset_overflow:(2,1),224,32;notbol:(2,1),256,32;noteol:(2,1),288,32;utf8:(2,1),320,32;endonly:(2,1),352,32;notempty:(2,1),384,32;start_code:(2,12),416,32;start_subject:(2,12),448,32;end_subject:(2,12),480,32;start_match:(2,12),512,32;end_match_ptr:(2,12),544,32;end_offset_top:(0,1),576,32;capture_last:(0,1),608,32;start_offset:(0,1),640,32;recursive:(2,23)=*(2,21),672,32;callout_data:(18,2),704,32;thisframe:(2,24)=*(2,25)=xsheapframe:,736,32;;match_data:t(2,26)=(2,22)pcre_maketables:F(2,5)yield:r(20,2)p:r(20,2)i:r(0,1)x:r(0,1)x:r(0,1)%,4@maketables.cmemsettoupper__ctypestrchrtolowerpcre_mallocpcre_maketables  $ D L h     , 0     as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.24W @ L   X('80(P8(X C) 0 N)<\get.o/ 1076671861 10 10 100644 13896 ` ELF44( .shstrtab.text.stab.stabstr.symtab.strtab.rela.text.rela.stab.comment㿀  @쀢 3쀠`0?  @耢 (  @䀢 !쀠` @0`@ 8`@@@  " @$' 쀠@4? (`@ 㿐.@6  ?@  @ @ ?`@@/㿐\@ @㿐 @  ,`@@``#@ @ ``@? . &@`$ ,`@@`$  @$`@.$㿐`@㿐.@6  ?``#  ?@@ .'㿐@ @㿐`@;d"d(<7a{K'Vf3Xǂ!dȂ/E+Â+$U;~E ;\‚܀ ƀ; K X i q 5{ M c < A !G ]O q m ̀ @w Z ÀdÀπ-S5qFNˀZe$?@>@>D?DEDG$DI0DKPDOlDRxDQ|DRDSDRDSDTDUDXDLDY@@ԀAB@BC @Q@R#@Sx,@Q7@RE@SN@QY@Rg@Sp$q${@y @y@y@z@z@zD{D}D{ D}D0D@DXD`Dd@|d$l$#@/@?@O@b@ u@\DD DDD$D0D8@@ 8$@$@@@@DDDD DDDDD,D0D4D8D<DDDLDTD`DdDhDlDxD|DDDDDDDDDDDD@@*@>@W@`@k@v@$$@DDD $ $@@@@@DDD DD4D8D<D@DDDHDXDdD!hDlDtD xD"|%@2@|C$D$Cd@Ap@A@A@B@B @BDCDD DCDEDF(DG0@D 0$8$Y@XDYDZDZ $ dget.c/usr2/SOURCES/S9/pcre-4.5/get.cgcc2_compiled.int:t(0,1)=r(0,1);-2147483648;2147483647;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,3);-2147483648;2147483647;unsigned int:t(0,4)=r(0,4);000000000000000000000000;000000000000037777777777;long unsigned int:t(0,5)=r(0,5);000000000000000000000000;000000000000037777777777;long long int:t(0,6)=@s64;r(0,6);001000000000000000000000;000777777777777777777777;long long unsigned int:t(0,7)=@s64;r(0,7);000000000000000000000000;001777777777777777777777;short int:t(0,8)=@s16;r(0,8);-32768;32767;short unsigned int:t(0,9)=@s16;r(0,9);0;65535;signed char:t(0,10)=@s8;r(0,10);-128;127;unsigned char:t(0,11)=@s8;r(0,11);0;255;__int128_t:t(0,12)=@s128;r(0,12);000000000000000000000000;0377777777777777777777777777777777;__uint128_t:t(0,13)=@s128;r(0,13);000000000000000000000000;0377777777777777777777777777777777;float:t(0,14)=r(0,1);4;0;double:t(0,15)=r(0,1);8;0;long double:t(0,16)=r(0,1);16;0;complex int:t(0,17)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,18)=R3;8;0;complex double:t(0,19)=R4;16;0;complex long double:t(0,20)=R5;32;0;__builtin_va_list:t(0,21)=*(0,22)=(0,22)_Bool:t(0,23)=@s8;-16;get.cinternal.hconfig.h/usr/include/ctype.h/usr/include/iso/ctype_iso.h/usr/include/sys/feature_tests.h/usr/include/sys/isa_defs.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/limits.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/syslimits.h/usr/include/iso/limits_iso.h/usr/include/sys/int_limits.hclock_t:t(9,1)=(0,3)/usr/include/setjmp.h/usr/include/iso/setjmp_iso.hjmp_buf:t(13,1)=(13,2)=ar(13,3)=r(13,3);000000000000000000000000;000000000000037777777777;;0;11;(0,1)sigjmp_buf:t(12,1)=(12,2)=ar(13,3);0;18;(0,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdarg.h__gnuc_va_list:t(14,1)=(0,21)va_list:t(14,2)=(14,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stddef.hptrdiff_t:t(15,1)=(0,1)size_t:t(15,2)=(0,4)wchar_t:t(15,3)=(0,3)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio.h/usr/include/iso/stdio_iso.h/usr/include/sys/va_list.h__va_list:t(18,1)=(18,2)=*(0,22)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio_tag.h__FILE:t(19,1)=(19,2)=xs__FILE:/usr/include/stdio_impl.hssize_t:t(20,1)=(0,1)__FILE:T(19,2)=s16_cnt:(20,1),0,32;_ptr:(20,2)=*(0,11),32,32;_base:(20,2),64,32;_flag:(0,11),96,8;_file:(0,11),104,8;__orientation:(0,4),112,2;__ionolock:(0,4),114,1;__seekable:(0,4),115,1;__filler:(0,4),116,4;;__longlong_t:t(17,1)=(0,6)FILE:t(17,2)=(19,1)fpos_t:t(17,3)=(0,3)off_t:t(16,1)=(0,3)off64_t:t(16,2)=(17,1)fpos64_t:t(16,3)=(17,1)/usr/include/stdlib.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/iso/stdlib_iso.hdiv_t:t(22,1)=(22,2)=s8quot:(0,1),0,32;rem:(0,1),32,32;;ldiv_t:t(22,3)=(22,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;lldiv_t:t(21,1)=(21,2)=s16quot:(0,6),0,64;rem:(0,6),64,64;;uid_t:t(21,3)=(0,3)/usr/include/string.h/usr/include/iso/string_iso.hpcre.hpcre:t(25,1)=(25,2)=xsreal_pcre:pcre_extra:T(25,3)=s16flags:(0,5),0,32;study_data:(18,2),32,32;match_limit:(0,5),64,32;callout_data:(18,2),96,32;;pcre_extra:t(25,4)=(25,3)pcre_callout_block:T(25,5)=s40version:(0,1),0,32;callout_number:(0,1),32,32;offset_vector:(25,6)=*(0,1),64,32;subject:(25,7)=*(25,8)=k(0,2),96,32;subject_length:(0,1),128,32;start_match:(0,1),160,32;current_position:(0,1),192,32;capture_top:(0,1),224,32;capture_last:(0,1),256,32;callout_data:(18,2),288,32;;pcre_callout_block:t(25,9)=(25,5)BOOL:t(2,1)=(0,1) :T(2,2)=eESC_A:1,ESC_G:2,ESC_B:3,ESC_b:4,ESC_D:5,ESC_d:6,ESC_S:7,ESC_s:8,ESC_W:9,ESC_w:10,ESC_dum1:11,ESC_C:12,ESC_Z:13,ESC_z:14,ESC_E:15,ESC_Q:16,ESC_REF:17,; :T(2,3)=eOP_END:0,OP_SOD:1,OP_SOM:2,OP_NOT_WORD_BOUNDARY:3,OP_WORD_BOUNDARY:4,OP_NOT_DIGIT:5,OP_DIGIT:6,OP_NOT_WHITESPACE:7,OP_WHITESPACE:8,OP_NOT_WORDCHAR:9,OP_WORDCHAR:10,OP_ANY:11,OP_ANYBYTE:12,OP_EODN:13,OP_EOD:14,OP_OPT:15,OP_CIRC:16,OP_DOLL:17,OP_CHARS:18,OP_NOT:19,OP_STAR:20,OP_MINSTAR:21,OP_PLUS:22,OP_MINPLUS:23,OP_QUERY:24,OP_MINQUERY:25,OP_UPTO:26,OP_MINUPTO:27,OP_EXACT:28,OP_NOTSTAR:29,OP_NOTMINSTAR:30,OP_NOTPLUS:31,OP_NOTMINPLUS:32,OP_NOTQUERY:33,OP_NOTMINQUERY:34,OP_NOTUPTO:35,OP_NOTMINUPTO:36,OP_NOTEXACT:37,OP_TYPESTAR:38,OP_TYPEMINSTAR:39,OP_TYPEPLUS:40,OP_TYPEMINPLUS:41,OP_TYPEQUERY:42,OP_TYPEMINQUERY:43,OP_TYPEUPTO:44,OP_TYPEMINUPTO:45,OP_TYPEEXACT:46,OP_CRSTAR:47,OP_CRMINSTAR:48,OP_CRPLUS:49,OP_CRMINPLUS:50,OP_CRQUERY:51,OP_CRMINQUERY:52,OP_CRRANGE:53,OP_CRMINRANGE:54,OP_CLASS:55,OP_NCLASS:56,OP_XCLASS:57,OP_REF:58,OP_RECURSE:59,OP_CALLOUT:60,OP_ALT:61,OP_KET:62,OP_KETRMAX:63,OP_KETRMIN:64,OP_ASSERT:65,OP_ASSERT_NOT:66,OP_ASSERTBACK:67,OP_ASSERTBACK_NOT:68,OP_REVERSE:69,OP_ONCE:70,OP_COND:71,OP_CREF:72,OP_BRAZERO:73,OP_BRAMINZERO:74,\OP_BRANUMBER:75,OP_BRA:76,;uschar:t(2,4)=(0,11)real_pcre:T(25,2)=s28magic_number:(0,5),0,32;size:(15,2),32,32;tables:(2,5)=*(2,6)=k(0,11),64,32;options:(0,5),96,32;top_bracket:(0,9),128,16;top_backref:(0,9),144,16;first_byte:(0,9),160,16;req_byte:(0,9),176,16;name_entry_size:(0,9),192,16;name_count:(0,9),208,16;;real_pcre:t(2,7)=(25,2)pcre_study_data:T(2,8)=s40size:(15,2),0,32;options:(2,4),32,8;start_bits:(2,9)=ar(13,3);0;31;(2,4),40,256;;pcre_study_data:t(2,10)=(2,8)compile_data:T(2,11)=s44lcc:(2,12)=*(2,13)=k(2,4),0,32;fcc:(2,12),32,32;cbits:(2,12),64,32;ctypes:(2,12),96,32;start_code:(2,12),128,32;name_table:(2,14)=*(2,4),160,32;names_found:(0,1),192,32;name_entry_size:(0,1),224,32;top_backref:(0,1),256,32;backref_map:(0,4),288,32;req_varyopt:(0,1),320,32;;compile_data:t(2,15)=(2,11)branch_chain:T(2,16)=s8outer:(2,17)=*(2,16),0,32;current:(2,14),32,32;;branch_chain:t(2,18)=(2,16)recursion_info:T(2,19)=s24prevrec:(2,20)=*(2,19),0,32;group_num:(0,1),32,32;after_call:(2,12),64,32;save_start:(2,12),96,32;offset_save:(25,6),128,32;saved_max:(0,1),160,32;;recursion_info:t(2,21)=(2,19)match_data:T(2,22)=s96match_call_count:(0,5),0,32;match_limit:(0,5),32,32;offset_vector:(25,6),64,32;offset_end:(0,1),96,32;offset_max:(0,1),128,32;lcc:(2,12),160,32;ctypes:(2,12),192,32;offset_overflow:(2,1),224,32;notbol:(2,1),256,32;noteol:(2,1),288,32;utf8:(2,1),320,32;endonly:(2,1),352,32;notempty:(2,1),384,32;start_code:(2,12),416,32;start_subject:(2,12),448,32;end_subject:(2,12),480,32;start_match:(2,12),512,32;end_match_ptr:(2,12),544,32;end_offset_top:(0,1),576,32;capture_last:(0,1),608,32;start_offset:(0,1),640,32;recursive:(2,23)=*(2,21),672,32;callout_data:(18,2),704,32;thisframe:(2,24)=*(2,25)=xsheapframe:,736,32;;match_data:t(2,26)=(2,22)pcre_get_stringnumber:F(0,1)code:P(1,1)=*(1,2)=k(25,1)stringname:P(25,7)rc:r(0,1)entrysize:(0,1)top:(0,1)bot:r(0,1)nametable:(2,14)mid:r(0,1)entry:r(2,14)c:r(0,1)mid:r(0,1)entry:r(2,14)c:r(0,1)mid:r(0,1)entry:r(2,14)c:r(0,1)pcre_copy_substring:F(0,1)subject:P(25,7)ovector:P(25,6)stringcount:P(0,1)stringnumber:P(0,1)buffer:P(1,3)=*(0,2)size:P(0,1)yield:r(0,1)pcre_copy_named_substring:F(0,1)code:P(1,1)subject:P(25,7)ovector:P(25,6)stringcount:P(0,1)stringname:P(25,7)buffer:P(1,3)size:p(0,1)size:r(0,1)n:r(0,1)pcre_get_substring_list:F(0,1)subject:P(25,7)ovector:P(25,6)stringcount:P(0,1)listptr:P(1,4)=*(1,5)=*(25,7)i:r(0,1)size:r(0,1)double_count:r(0,1)stringlist:r(1,6)=*(1,3)p:r(1,3)len:r(0,1)len:r(0,1)len:r(0,1)pcre_free_substring_list:F(0,22)pointer:P(1,5)pcre_get_substring:F(0,1)subject:P(25,7)ovector:P(25,6)stringcount:P(0,1)stringnumber:P(0,1)stringptr:P(1,5)yield:r(0,1)substring:r(1,3)pcre_get_named_substring:F(0,1)code:P(1,1)subject:P(25,7)ovector:P(25,6)stringcount:P(0,1)stringname:P(25,7)stringptr:P(1,5)n:r(0,1)pcre_free_substring:F(0,22)pointer:P(25,7)P "8;t T[is\@lget.cpcre_free_substringmemcpypcre_get_named_substringpcre_free_substring_liststrcmppcre_fullinfopcre_freepcre_get_substringpcre_get_substring_listpcre_get_stringnumberpcre_copy_named_substringpcre_copy_substring.umulpcre_malloc < X  Hx  <x |   $@ T X     h  pas: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.24O p  00(102 ;3 F4\\study.o/ 1076671864 10 10 100644 15252 ` ELF94( .shstrtab.text.rodata.stab.stabstr.symtab.strtab.rela.text.rela.stab.comment:`3`@ ;` ` **  @ `  @ 0` `*@* 㿈   K   A`? [?`F(``@  (`@  `="  `2   (`@ `="ؠ D   @ @ `@3 .@ $    @ @ `@@ .@ $    @ @ 3 .@ $    @ @ @ .@ $    @ @ `3 .@ $    @ @ `@ .@ $    `  c  \  T `   `8 (``@̂   @ @ `@3 .@ $ o   @ @ `@@ .@ $ b   @ @ 3 .@ $ V   @ @ @ .@ $ J   @ @ `3 .@ $ =   @ @ `@ .@ $ 0   A @ @ .@ $@  :0`8` `"  *`":`;`0`@8`@ `*  .@`?: р`8 (``@  (`@ `  @ @ .@ $@  " `?.`.`.`.`.`.`.`.`    '  (`@  `="    @ @  & ԂbE@`&9 `` `@0   @ ''????2` '  `'И  `@ 8   & &+` (&  @ Ȃ` unknown or incorrect option bit(s) setargument is not a compiled regular expressionfailed to get memory/j d$d,<;eO+Z j7\͂ 'j΂5E+ɂ +*UAEǂ &AbȂ ̀; K X i $q ;{ S i < A 'G cO w m Ӏ Fw ` ɀjɀՀ-Y5wFN"рZk$=@<@< @< @< D=D>D?D>D?(D@DDAd$l$Z@X@X @X@Y&@YDZDgDhDo Dv8DXD|DDpDuDvDxDDDDDDD D$D8DPDTDhDDDDDDDDDDDDDDD,D*,D4DDDLDTDc\DdDD D D DDDDDDD0D4DHD`D dD|D$D%D$DDVD<DVDFDGDIDK<DLDDMdDLhDMlDGpD[D\DlDgD3D5D6D5D6D5 D6$D@DhDpDqDy0@[ 9cL@gZ@hj@gx@h@g@h@K <p$ $@@@DDDDDDDD<DHDPD\DtDxD|DDDDDDDDDDDDDDDDDDDDD DDD$D,$@1@ F@S,h$4idstudy.c/usr2/SOURCES/S9/pcre-4.5/study.cgcc2_compiled.int:t(0,1)=r(0,1);-2147483648;2147483647;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,3);-2147483648;2147483647;unsigned int:t(0,4)=r(0,4);000000000000000000000000;000000000000037777777777;long unsigned int:t(0,5)=r(0,5);000000000000000000000000;000000000000037777777777;long long int:t(0,6)=@s64;r(0,6);001000000000000000000000;000777777777777777777777;long long unsigned int:t(0,7)=@s64;r(0,7);000000000000000000000000;001777777777777777777777;short int:t(0,8)=@s16;r(0,8);-32768;32767;short unsigned int:t(0,9)=@s16;r(0,9);0;65535;signed char:t(0,10)=@s8;r(0,10);-128;127;unsigned char:t(0,11)=@s8;r(0,11);0;255;__int128_t:t(0,12)=@s128;r(0,12);000000000000000000000000;0377777777777777777777777777777777;__uint128_t:t(0,13)=@s128;r(0,13);000000000000000000000000;0377777777777777777777777777777777;float:t(0,14)=r(0,1);4;0;double:t(0,15)=r(0,1);8;0;long double:t(0,16)=r(0,1);16;0;complex int:t(0,17)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,18)=R3;8;0;complex double:t(0,19)=R4;16;0;complex long double:t(0,20)=R5;32;0;__builtin_va_list:t(0,21)=*(0,22)=(0,22)_Bool:t(0,23)=@s8;-16;study.cinternal.hconfig.h/usr/include/ctype.h/usr/include/iso/ctype_iso.h/usr/include/sys/feature_tests.h/usr/include/sys/isa_defs.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/limits.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/syslimits.h/usr/include/iso/limits_iso.h/usr/include/sys/int_limits.hclock_t:t(9,1)=(0,3)/usr/include/setjmp.h/usr/include/iso/setjmp_iso.hjmp_buf:t(13,1)=(13,2)=ar(13,3)=r(13,3);000000000000000000000000;000000000000037777777777;;0;11;(0,1)sigjmp_buf:t(12,1)=(12,2)=ar(13,3);0;18;(0,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdarg.h__gnuc_va_list:t(14,1)=(0,21)va_list:t(14,2)=(14,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stddef.hptrdiff_t:t(15,1)=(0,1)size_t:t(15,2)=(0,4)wchar_t:t(15,3)=(0,3)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio.h/usr/include/iso/stdio_iso.h/usr/include/sys/va_list.h__va_list:t(18,1)=(18,2)=*(0,22)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio_tag.h__FILE:t(19,1)=(19,2)=xs__FILE:/usr/include/stdio_impl.hssize_t:t(20,1)=(0,1)__FILE:T(19,2)=s16_cnt:(20,1),0,32;_ptr:(20,2)=*(0,11),32,32;_base:(20,2),64,32;_flag:(0,11),96,8;_file:(0,11),104,8;__orientation:(0,4),112,2;__ionolock:(0,4),114,1;__seekable:(0,4),115,1;__filler:(0,4),116,4;;__longlong_t:t(17,1)=(0,6)FILE:t(17,2)=(19,1)fpos_t:t(17,3)=(0,3)off_t:t(16,1)=(0,3)off64_t:t(16,2)=(17,1)fpos64_t:t(16,3)=(17,1)/usr/include/stdlib.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/iso/stdlib_iso.hdiv_t:t(22,1)=(22,2)=s8quot:(0,1),0,32;rem:(0,1),32,32;;ldiv_t:t(22,3)=(22,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;lldiv_t:t(21,1)=(21,2)=s16quot:(0,6),0,64;rem:(0,6),64,64;;uid_t:t(21,3)=(0,3)/usr/include/string.h/usr/include/iso/string_iso.hpcre.hpcre:t(25,1)=(25,2)=xsreal_pcre:pcre_extra:T(25,3)=s16flags:(0,5),0,32;study_data:(18,2),32,32;match_limit:(0,5),64,32;callout_data:(18,2),96,32;;pcre_extra:t(25,4)=(25,3)pcre_callout_block:T(25,5)=s40version:(0,1),0,32;callout_number:(0,1),32,32;offset_vector:(25,6)=*(0,1),64,32;subject:(25,7)=*(25,8)=k(0,2),96,32;subject_length:(0,1),128,32;start_match:(0,1),160,32;current_position:(0,1),192,32;capture_top:(0,1),224,32;capture_last:(0,1),256,32;callout_data:(18,2),288,32;;pcre_callout_block:t(25,9)=(25,5)BOOL:t(2,1)=(0,1) :T(2,2)=eESC_A:1,ESC_G:2,ESC_B:3,ESC_b:4,ESC_D:5,ESC_d:6,ESC_S:7,ESC_s:8,ESC_W:9,ESC_w:10,ESC_dum1:11,ESC_C:12,ESC_Z:13,ESC_z:14,ESC_E:15,ESC_Q:16,ESC_REF:17,; :T(2,3)=eOP_END:0,OP_SOD:1,OP_SOM:2,OP_NOT_WORD_BOUNDARY:3,OP_WORD_BOUNDARY:4,OP_NOT_DIGIT:5,OP_DIGIT:6,OP_NOT_WHITESPACE:7,OP_WHITESPACE:8,OP_NOT_WORDCHAR:9,OP_WORDCHAR:10,OP_ANY:11,OP_ANYBYTE:12,OP_EODN:13,OP_EOD:14,OP_OPT:15,OP_CIRC:16,OP_DOLL:17,OP_CHARS:18,OP_NOT:19,OP_STAR:20,OP_MINSTAR:21,OP_PLUS:22,OP_MINPLUS:23,OP_QUERY:24,OP_MINQUERY:25,OP_UPTO:26,OP_MINUPTO:27,OP_EXACT:28,OP_NOTSTAR:29,OP_NOTMINSTAR:30,OP_NOTPLUS:31,OP_NOTMINPLUS:32,OP_NOTQUERY:33,OP_NOTMINQUERY:34,OP_NOTUPTO:35,OP_NOTMINUPTO:36,OP_NOTEXACT:37,OP_TYPESTAR:38,OP_TYPEMINSTAR:39,OP_TYPEPLUS:40,OP_TYPEMINPLUS:41,OP_TYPEQUERY:42,OP_TYPEMINQUERY:43,OP_TYPEUPTO:44,OP_TYPEMINUPTO:45,OP_TYPEEXACT:46,OP_CRSTAR:47,OP_CRMINSTAR:48,OP_CRPLUS:49,OP_CRMINPLUS:50,OP_CRQUERY:51,OP_CRMINQUERY:52,OP_CRRANGE:53,OP_CRMINRANGE:54,OP_CLASS:55,OP_NCLASS:56,OP_XCLASS:57,OP_REF:58,OP_RECURSE:59,OP_CALLOUT:60,OP_ALT:61,OP_KET:62,OP_KETRMAX:63,OP_KETRMIN:64,OP_ASSERT:65,OP_ASSERT_NOT:66,OP_ASSERTBACK:67,OP_ASSERTBACK_NOT:68,OP_REVERSE:69,OP_ONCE:70,OP_COND:71,OP_CREF:72,OP_BRAZERO:73,OP_BRAMINZERO:74,\OP_BRANUMBER:75,OP_BRA:76,;uschar:t(2,4)=(0,11)real_pcre:T(25,2)=s28magic_number:(0,5),0,32;size:(15,2),32,32;tables:(2,5)=*(2,6)=k(0,11),64,32;options:(0,5),96,32;top_bracket:(0,9),128,16;top_backref:(0,9),144,16;first_byte:(0,9),160,16;req_byte:(0,9),176,16;name_entry_size:(0,9),192,16;name_count:(0,9),208,16;;real_pcre:t(2,7)=(25,2)pcre_study_data:T(2,8)=s40size:(15,2),0,32;options:(2,4),32,8;start_bits:(2,9)=ar(13,3);0;31;(2,4),40,256;;pcre_study_data:t(2,10)=(2,8)compile_data:T(2,11)=s44lcc:(2,12)=*(2,13)=k(2,4),0,32;fcc:(2,12),32,32;cbits:(2,12),64,32;ctypes:(2,12),96,32;start_code:(2,12),128,32;name_table:(2,14)=*(2,4),160,32;names_found:(0,1),192,32;name_entry_size:(0,1),224,32;top_backref:(0,1),256,32;backref_map:(0,4),288,32;req_varyopt:(0,1),320,32;;compile_data:t(2,15)=(2,11)branch_chain:T(2,16)=s8outer:(2,17)=*(2,16),0,32;current:(2,14),32,32;;branch_chain:t(2,18)=(2,16)recursion_info:T(2,19)=s24prevrec:(2,20)=*(2,19),0,32;group_num:(0,1),32,32;after_call:(2,12),64,32;save_start:(2,12),96,32;offset_save:(25,6),128,32;saved_max:(0,1),160,32;;recursion_info:t(2,21)=(2,19)match_data:T(2,22)=s96match_call_count:(0,5),0,32;match_limit:(0,5),32,32;offset_vector:(25,6),64,32;offset_end:(0,1),96,32;offset_max:(0,1),128,32;lcc:(2,12),160,32;ctypes:(2,12),192,32;offset_overflow:(2,1),224,32;notbol:(2,1),256,32;noteol:(2,1),288,32;utf8:(2,1),320,32;endonly:(2,1),352,32;notempty:(2,1),384,32;start_code:(2,12),416,32;start_subject:(2,12),448,32;end_subject:(2,12),480,32;start_match:(2,12),512,32;end_match_ptr:(2,12),544,32;end_offset_top:(0,1),576,32;capture_last:(0,1),608,32;start_offset:(0,1),640,32;recursive:(2,23)=*(2,21),672,32;callout_data:(18,2),704,32;thisframe:(2,24)=*(2,25)=xsheapframe:,736,32;;match_data:t(2,26)=(2,22)set_bit:f(0,22)start_bits:P(2,14)c:P(0,1)caseless:P(2,1)cd:P(1,1)=*(2,15)set_start_bits:f(2,1)code:P(2,12)start_bits:P(2,14)caseless:P(2,1)utf8:P(2,1)cd:P(1,1)c:r(0,1)dummy:(1,2)=B(0,1)tcode:r(2,12)try_next:r(2,1)tcode:r(2,12)try_next:r(2,1)tcode:r(2,12)try_next:r(2,1)d:r(0,1)pcre_study:F(1,3)=*(25,4)external_re:P(1,4)=*(1,5)=k(25,1)options:P(0,1)errorptr:P(1,6)=*(25,7)start_bits:(2,9)extra:r(1,3)study:r(1,7)=*(2,10)code:r(2,14)compile_block:(2,15) l l '-94study.cset_start_bitsset_bitmemcpy.umulpcre_mallocpcre_study p p T T 4  448<@DHL$P$TX8\l`dhlp$tXx| Tdhh 44 $(,048<<p@DHLPTX\`dhlptx|   ( ( ` d x X X 8l <as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.24W  Pm @ j(3l04,D84p C98H N9\pcre.o/ 1076671886 10 10 100644 103364 ` ELFl4(.shstrtab.text.rodata.data.bss.stab.stabstr.symtab.strtab.rela.text.rela.rodata.rela.data.rela.stab.comment ?ԂbE@?` b @"@ @ "  @`?8 㿐`?`? @M?ԂbE@G?` @`2` =?.;`@ b@&0 & @"@`?8` ```  @?ڂ`ׂ @ ?(``@"@   "@ &%b 㿐 ` `?ЀJ8"`@WH "8d@.;`@`#@ `/`78  . @ `/`7(ذ %` ;`@   .  @@@Ѐ     @  @` 7?О  ? `,#@`(? @@"$"`  ;`@  ``4. `@@аɀ~ `2"   `2 ` `}  `2  `}! `,  `}   ` ` `}  `2  `}`? 㿐 `` ? .@@@  Ђ `}" `}``  .`@ @@@`?c  @  @""`#" `H"(``@$  @ @ @2"@   (`@  ="  ` @ܐ 㿐 ?   `K4 L`LK(``@ `  (`@ `="   ߠ M?  `ְ`   (`@ Π ! р`8Ǡ (``@    (`@ +`@ @&?   ?` @? `=    (`@ ="  ` @ ` ` ``L `@  (`@ @  0   @  ` ` `;``L$    @  㿐   'K-  (`@ C  "  (`@ `= 4  `@  c  ݰ& Д 2  `;8(``@ !р` !(``@  (`@ Ԙ 0  㿐 \       ^"  ` @   `2  @ "   `]2 "@  㿐 `` ` ` @@ ,   @` ? @  㿐 (`@ @@* @8`* *   2 'D6 `''L''H'T'X ?!'P'' d' ' ''??''  @@ j | @` #`' |8\`, @ XL @\ @P# @   ,Ⱥ '`' ``?' L'H`M`'`# K, ';`,  ', ,?`@ #\`#`#l#p (H#hT'#d@Ȁ Z G@`K''  `F`? ?`G`A @`)`T#P #@`? ``6@'`? '?'  (`@  `>   ?''ɂ``E4 `' ߀`18|ȃ(``@Ȣ`'``)1 ' @`)*` B'Ȣ`'Ȃ G' `R0`@ `X'Ș ' `)ȃ* @`' `@ )@@ Ѐ Ț ` H',,:,4'`Tl#@? H,,,Ș `'#' `@ `  *'Ȃ@ @@ @ `Ѐ&,    (`@ "` ;, $ ;`, $,  " ;`"` - ڠ L'`Ȣ`'``! `=K` C'I'` D'D' Aa' F' <,`' ``@ ` ȃ* @`' `@ @ @`@ Ѐ,Ȧ` o`Ȣ`' `` <JÂ`` `'  `) `' @`) $@ @ 6Ȓ @    `@ >`@ `>  (`Y@ , ::,, $ (@   % $% Ȣ` '@``>' $@ @ 9@ ``)? &   `@ H`8`, `@,+` `%  @"@HC`ߢ'' @ `) `:@ @  `iY'Ȁ`iD`s`U"?@7`X`-" @ ` `) `:@ @  @ `)+@ '` L''  @  ,,ȦD6 #@` '+``'' t @`@"@b`s`x`m@`@`@`@`Ȣ`r''Ė?'`Ā`' `@ @ '+` +' ?@`;r`` [ V 8qɠ " (Ā`60-,8`,,,` (Ȃ@ % ($@  F(@ >, < ,,(`+`,ݦ`,Ħ8`,,&,Āʘ,Ė#@',ނ@``d"```/``` :`  ``?@3 K- Ă``$`?`5 "3,Ħ8`,,:,,' {,倠`1/x   F`?  G'x$  Ā`i`瀢U  ,I`@/@ L`/@`/@/``'6 I L,  ,'$,8`,@?# >$`$  (`@ " $,; ,,**ۂ x$?+@  ,Ƞ`I@/@ 62  " @Ġ    (`@  `>2 $ o'xW`` ` `/`'Ā` ( @ @  L/@$ >/`;`/`,,,@`y'Ȣ` 'ȶ s'"` S'Ā?"? ,Ⱥ''G  `:.`?`? к=ΐ`'` ^'   ?????s [ \hȃ< 0`8`   *   ( @4  ? *@+?ȶ`'` ]܀݀ \"?"?'` 8 , 8,  $5  7, @  ?"? ,',;Ȁ?  (' @  , ,?' `E<   'Ȁ \GH ``-<  ``]`' @ \*H#4Ȗ  < 0`8` *   (  @0` ?`*@+? wڂ`T@Ȗ  Ҁ?ΐ J'T@Ȗ ?x?i Ȃ  `Y (``@  `@ @ *=Ƞ  `@ 3 *0Ƞ   3 (Ȃ`!/Ѡ   @ (  ` 3 *Ƞ  ` @ *Ȁ @N @Â` ``\" ` `E2 7`  `:.`?`? =. \ ' \'| ` `:[`' ``^"Q`̐"@ F    @?  @3* `@Ȕ @`@`?|   3 *`"`т`(@#8`+ #@(`D`@' `)" *d @P  @h&; @*܂'ܐ(@ID : ,,?``'@ܰ &؀@  &?` ` =}@2?`䀠`6 = '㿐   L"   (`@  (@   <   (`@ `=ݒ1 LA`?`?  FG`?`? ڒޔ`@`  ` "  `( @0` `@ @ Ȃ 㿐  I L!   (`@  (@ @`  -   (`@ `="ޔ " LA`?`?  FG`?`? ߒ`  ` @"  ׂ 㿐?   K4 L`:(``@,? (? &@ !  (`@ `=ܐ ` ! A˔`? ? 〤 0'  ? '  ( "&&h݂`?a@  !"#@''''Ԁ '''̀ 『`ʂ? `À #Ԃ`'`  @4`@` @ `& & ԂbE6 'ܑ, & & '6 'ؓ-2 @2` L'''',Ԃ#p'#\#`#l`#d#h6   6 @``&(@` @@'`&  @(`&`L`"` aba`@ @ "   6 & }~'#  `& &! @@"  6 @  '[ " `@Ԃ$@&E &`,?܀`X`(``@ԐԒ  `〢 K \'Ԧ  \Ԥ̢`'`K@` 4' ``E2` 'Ԁ` \ `Ԁ # \ԒИ ` 6'Ԣ`'` ƀ À?F?ۦ   (@@`'4' ``{ɦ` ԒА Ė`q'Ѐ ̚` 8`?`? 2 ̦ ``?`'Ԁ2 Ԓ ` `?@ ```' ` @({ԃ/` @ ` |y`,& `?߀`180(``@`' `)@ @  ' @`)@ @  @`2P؂` ``R"7 ` `  '  `   ' @ ` @`)``' ``?2 ` = !@ @ `ǀ <`Ǣ'``)2 `'Ԣ` R 'Ԗ '  ` @`)] `?ւ`` ?`  ``?@ { ` {6 *1 ++ ?# ''Ѐ ?̀ ?@ ``+̂`)@̀@ @@?'Ж `''Ԃ '?'z` ԒА `'W$@(``'  `=`!`? `? `~``'ԖԢ`' ` `2Ԁ`){``' `<Â``̚`' ` `2`)```' ̐  ` ' @ ` @`>$@@ ''''Ȗ @?׀`OB(``@`"'Ԁ` Ă@'IJ(@ 'Ȫ?Ě@` )` @ )`ǀ` `? `?@ 2 זӂbЂ`@͂`ʂ``Ă``'Ԁ` /` {@ |$  Ԣ`' ``^  @`M S @`\"I ` `'``> 2 @`] `6 " ``{!}` ԒА ﮖ`['Ѐ ̚` 8`?`? 2 ̦ ``+ꀠ`?¢`2``E2 ` 'Ԁ`\`[2  "Ԡ `ԒA `?" ?   `'O  "#ԒА I`'Ѐ ̂8 `?`? 2 $ ``?W`+`R'ԀԂ`Ԣ`'`  2 `‚``&㿐. @<8 @@% @  `  ` @ @` ` @ ?`2&\`'X'\X@ `L $```(`@ ` L`L(``@ #\`Ϛ ``(`@ @@`= 0`T`"`0``2`0@```%`T@*` %`@``"%`H`@ %`H%`Dܔ `8  ``8`P @`8 ?` `2 `<  ` `2  ``@"@ @2@ `<  `  ̀``<  `  `2o`0`<  `  ``<  `  뀈``<  `  ``< u `  ׀`  `<  ` e   0_`<`< Y 2.` ` "*`0Q`< y 0L`!`` ``8 C h "`? c` " `$`< :`$ W``+ `,``< #2` ` "`0``<`"  ?`@ @ @   ` ?@֐?@ @` ?@`<   `  `@ @ @`@2@0@ @` `K@ ``H@ c`<"ɔ @ R``  @ @   `@$#\o @ `<`  @ `0    `@   #\C? y:u  @  l `@$<#\" X@V `<R` 0L   `@  < #\? 0:, ``(` @ ` `U`?``(``@ N `K@ ``H@ c`<" @ R`` @    `@$Ȁ#\ 䀤@ `<`  @ `0Հ    `@  Ĕ #\ ?:  @   `@$z#\` @ `<` 0   `@  z #\9 o?:i ``(` @ `$ `T`?``(``@ M ښ`K@ ``H@ c`<@"`B `8(``@ 2 @  ` * `@$L#\ߚ @6 `<8` (``@  `?7 ``@ ۢ`` @`` @`2Т`0` @퀈`` @`` @〈`` @뀈`ה `(``@ $%   ` `@   #\x? : %"4 〦` @ ݀`@ ׀Ӣ р` @ ˀ`@ ŀ ` @ `@  ` @ `@  ` @ `@  ` @ `@ } @` `* `@$ @` ` `@$ @쀤` ` `@$߀ @ۀ` ` `@$΀ @ʀ` ` `@$ @` `հ `@$``(` @ `- `?}```(` @ ``!@ `/t `4tр`6o ```` ``6+ `?+`@  c` @`<  4   ;@ ` `@ `#\F |@6z `< `4   ;@ ` l j `< 4   ;@ ``@  T #\? H:D   `H@` ` H@c2?``(`@ @``(`@@ `#@ @ `/p `4yр`6k```` ``6+ `?+`@  c`"@ @DՀ#\ @  `  ޔ #\ &:͔ ] 怦`@N  `@?  @{`H@` ` H@c`<"r````4+`@  `'  (`@ '`T` 'ؤز`'쀢 %`T@'`'`@*`@%`@' #\ ,  ``*@%`T  (`@  `="#\ؚ` %`T`@F ؂`%`T`@: `@* ? '00` "``8`<'0 @ ``L``X`@'@& 'H68`'8'T#@ '4'P'D'<'L0  6`0 ``(`@ @@="`ڂ ```(`@ &@ ?`` F`  ``?@q@ G?  (`@ `Q%`L %``T "@ @"<@ >`? `?`@ #\ `#\x " 0`#\l  #\  ` %`T%`@@* f`` `8 @(`.# & @ #`%`H%`D|  #\`: "@ m``(`@ @@="#\ `>` \`\ ``(`@ @@`="``H #\` E B``(`@ @@`=\`n 03```8(`@ & d 0) #\` "@ ``(`@ @@="#\ `F `=@ @  ``(`@ @@="``D>`? `?,`H``"/`@ #\ `#\ "֔ 0Ԕ`#\ ʂ #\?Ҹ@ ``H3 `#\z  ``(`@ @ `g#\``(`@ @``=```(`@ @@`="```(`@ @ c6 ``+`@  ````(`@ @` .#\e`T@  `#\ T``(`@ @@`="`` ````(`@ @@`="` `#\ "@0.`` `8.#@& +`  ` `L " #\` %`L``(`@ @@`=`, @ @#``  #+  @  ?bo@??\`?'' 'x't'p?`?`?@ <`? @0`@&%?'b`' @`2````'"@` '@ԂbE@r?` ``@6`0` ``'|@'`@c@'7` `''6` 6` `` ''7`7`` `'''''''@ ``$`'@ @/''@ `'@'`?'ܖ .2 8`(`"?`* ?"?:"` @|`3`` `@" *`` `@a3`' `'x* ?" *"  @   @2  0&c4.p80` ('x`e @`?@ `?* `?`@?'p ''#\ T   `?@ `؀@4'`@` ؛0`@ 8` Ԙ$#@%@%`q ,`@` @*  @~  z @2 t |`tȂ@k h ?` d  ` ?` 2 Z VU t0` `;@`L  * F @@ @  `  't`@@?`. '`  '!!:;<=>?@[\]^_` alphalowerupperalnumasciiblankcntrldigitgraphprintpunctspacewordxdigit``@`  @ 4.5 01-December-2003\ at end of patternPCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X\c at end of patternunrecognized character follows \numbers out of order in {} quantifiernumber too big in {} quantifiermissing )conditional group contains more than two branchesinvalid condition (?(0)recursive call could loop indefinitelyreference to non-existent subpatternnumber after (?C is > 255two named groups have the same nameinternal error: unexpected repeatnothing to repeatrange out of order in character classinvalid escape sequence in character classunknown POSIX class namePOSIX collating elements are not supportedPOSIX named classes are supported only within a class\C not allowed in lookbehind assertionlookbehind assertion is not fixed lengththis version of PCRE is not compiled with PCRE_UTF8 supportregular expression too largefailed to get memoryunmatched parenthesesinternal error: code overflowparentheses nested too deeplymissing ) after commentmalformed number after (?(assertion expected after (?((?R or (?digits must be followed by )unrecognized character after (?<closing ) for (?C expectedsyntax error after (?Punrecognized character after (?Punrecognized character after (?missing terminating ] for character classunknown option bit(s) seterroffset passed as NULL  !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~>~~x 7d#d*<9c}M)X h5Zʂ$g˂2E+Ƃ +'U>EĂ#>_ł߀ ɀ; K X i !q 8{ P f < A $G `O t m Ѐ Cw ] ƀgƀҀ-V5tFN΀Zh΀B$-D-D/$ $L@K ;@K J@K DLDNDO DP$DQ@DRLDTdDU]$^$ls@j@j@j@kDlDpDlDpDnDpDq(Ds@Dt\D\DyDDD}DDDDD D(D0D8D@DT@n T$$@@ DDD(D,D,D4D@DHDTD\ $| $# @!7@! P@! `@"o@" D#D$D#D) D#D)D* D#$D*,D18D2HDlD>tDKD{DzD{D~D|D]D_ Da D`0Da4D_8Da8DbDDcpDfDcDfDeDhDoDqDsDDDDDDDDDD DDD DDDLDXD~@$@%@% @=`h@=t@Dp@$$@DDD DTDdDtDDDD$$@@ %@ 2@ DDDD$D(D,D0DhDxD!D!D"D-D.D2$D5(C@N@(Y$0Z$Ly@K@K @K DLDODR,DUTDZ\DbDcDM$$@@DDDD DDDD$DDDPD\D`DDDDDDDDDDDDDDDDDDDDDDDDHDLDLDTD\DhDpDDDDDDD"@@@@@$0$8/@7<@7 H@7 D8D=D?D@ DADB$DD0DE<DFLDK\D=`DmxV@? _@D$\xh$i$~@@ DDDD DD$D0D8D@DX@X$`$@@@DDD D$D0DHDLDXDlD|DDDD?DDDDD ,D%HD@L@ @ @0@  @LL4$d5$YK@WX@Wh@W~@XDYDZD_ D\(D]@D``$h$w@v@v @v DwDyDzD{D|PD`D~tDxD@x $$@ @DDD DDDD,D<DPDx@x"$#$:@H@V@b@DDD DDDD<m@y@ @@LTT$\$DHРLPT X \ 0` >dDDD DDD D$D(D4D8D<D@DDDHDPDTDXD\D`DdDhDlDxD D'D(D*D,D-D6D=D?D=D>D@D> D@D?D@DADM$DQ$DR,DP0DQ4D 4D <D )<D &@D )DD )TD R`D ^tD e|D ^D eD ^D eD aD bD `D bD cD bD cD nD rD nD rD pD rD oD rD 4D @D DD HD LD PD TD D D D D D D D D D D D  D D D  D $D (D 8D <D DD PD `D lD D D D mD .D 1D 2D d$D e,D f4D 8<D ?<D ;@D ?HD KXD NlD O|D OD PD UD XD UD VD UD VD WD \D CD SD RD D BD AD BD A D D$D C(D D,D C0D D4D z4D <D PD `D D D D D D D D D D D D D D $D $D 6DD 7LD yLD iXD m|D lD mD lD nD rD qD rD qD sD _D `D xD }D D }D D D D (D 4D 8D <D @D HD PD pD D D D D D D D D D D D D D D D D D  D (D ,D 4D 4D 8D <D @D DD HD LD PD \D `D lD pD |D DD D D D D D D D D D D D D D D D D (D ,D 0D 4D 8D HD LD PD XD `D hD pD D S D D D D  D  D  D  D  D  D 0 dD # hD 0 tD # xD 0 |D K D J D K D K D 2 D 4 D 5 D < D = D < D = D ? D = D ? D > D ? D > D A D B D  D  D  D  4D  HD  TD  `D lD 2 |D 3 D 8 D @ D F D H D I D N D V D ^ D N D P D N D Q D N D ^ D N D ^ D i D n D D D D D D D D 0D 4D @D LD XD `D - `D , dD - hD < |D  D  D  D  D  D D D  D D  D D  D  D  D  D  D  D D D D $D (D  @D LD * \D + `D + hD * pD , tD  |D  D D D D  D B D I D ND P$D R,D VDD WHD VLD WPD X`D XdD YpD SD QD OD D `D dD nD eD fD nD |D D  D (D 4D 8D @D PD TD XD \D `D dD hD pD tD xD D D D D D D D D D D D D D D D D D  D D (D ,D 0D 4D <D HD `D tD D D D D D D D D D D D D D pD q D rDD PD \D `D `D hD lD pD |D D D D pD rD qD rD sD tD sD uD tD vD fD gD `D bD a D bD `D bDn D C D B$D 70DX<D\HD]PD[TDYXDZ\D\\D <dD =hD]pDqpDqtDzDDDDDDDDD$D(D0D8D@D\DdDhDDD DD D D D D D D D D 'D 'D #D $D #D $D #D $DDD(D4D<D@DDDHD HDPD\D`DdDlDxDDDDDDDDDDFDIDRDXDkDD$D@DDDLDTD\DxD|DD7DnDmD[D_DaDcDdDDDDDDDD D$DHD|D+D,D-D,D-D&D'D(D'D"$DXD4D9DD6DD D D0D0D4D8D<D@DLDTDdDtDDDDDDDDDDDDDD4DDDHDLDxDDDDDDD}D|D}D|DtD  D  D D D D  D 0D <D @D !DD "HD $LD "PD #TD *XD ,dD clD dpD ctD exD D D D D D D D  D D D D ,D 4D 8D <D @D /XD .\D /`D ;hD =tD >D LD OD ND OD ND OD PD BD D D D D  D (D ,D 0D 4D 8D DD LD `D D D DGDIDLD ,D -D .D - D .D .D1 D P I@ \@ g@ z@    @ Ȁ ݀ @!@!@!)!=!O!]@!p@ !@!@!@!!@!Ā!܀!!@"""&"B@"Y@ "o!"@" "#"$"%""Ԁ"@#@ #!#.@" #;##K$#\%#o@ 8D#z##@#@ #ր!#@" ##$$$%$(@ 8$3 +$= +$I@ , $X$k$@$@ $!$@" $Ҁ#$$$%$% +% +%@ , $%+@ M l%:@  %C@ <%R@ %` +%j +%v@ , %@ D%@  %@  @%@  HP%@ %@ %@ %@ %@ %@ %@ &@ &@  &@   &(@  p |&3@  &>@  &I@ c&R dx&b@ e&m@ f&}@ c& dx&@ e&@ f&@ c& dx&@ e&@ f&@ &@ '@ '@ D'"@ '7@ 'E@ HX'Q@ Xd'_@ p PP'k@H't@Tx'~@ '|'@'@'@0'@ 4'@ T'@ (LHP'$ ,'$( D(@ (,@ (= P(M@ (\@ (m \( `(d(h(l(ƠpDDD DDDDD D$D(D,D 4D<D @D!DDLD!PDTD!XD\D!`DdD!hD%pD)tD+D,D+D,D1D3D5D4D5D:DDDF$DG(Dl,D8DLDTDtDxD|DDDD%DDDDDDDDDDDDDDDDD D$D(D,D0D4D8D<DDDp`DodDphDrpDx|DtDuDvDvDUDWDXD^DcDeDcDeDdD_D((@ (@ (@) @)@)*@)5)@)L@)`@)v@)@))) )@ )@)@`)@n`(* $0* $* @*-@*=@*P@DDDDDD$D(DDD\DxDD DDDDD0D `*c@ *q@ *{@ $d*@ *@ *@ *@ `*$h*$'*@%*@%*@&D'D)D*D)D.D1$D2(D3DD4\DGtDHDJD9D:D?DADFDK +@) +@* +@0 $`+)@) +7@* +A@) +O@*  +Y$(+Z$e+x@d+@d+@dDeDfDiDkDmDo(DrLDTDXDdDpDDDDD~DxDzD+@f+@h+@i+@k +@h+@i+@k +@h+@i,@k ,$,$,/@,?@,N@,_@,s@DDD DD D D D D$D(D ,D%4D7@D*DD7HD>TDFhDapDHtDIxDJ|DGDQDRDaDHDIDJDaDjDnDpDDDDDDD$D,D<D<D@DDDLDPDTDXD\D`DdDhDlDpDDDDDDDDDDDDDDDDD(D,DDDdDtD |D DDEDDDDD$D(DHDLDPD\DhDtDDDDDADDqDwD}DDDDD(D0D4D64D78D?<DAHDtPDuTD~DDDDCDDDLDNDOD[D^D^D_D`DS(DTD`DhDlDtDDDDDDDDDD8D<DDD*TD-TDhDpDtD|D|DDDDDDDDDDDDDDDDDDDDD4D<DDD;D@DBDDDCDDDEDG$DM0DN4DQxDR|DQDRD=D>D>DDDDDDDD 0D 4D 8D 8D HD TD \D dD lD |D D( D* D+ D D! D! D" D ,D DD HD LD `D `D, hD- pD- D1 D/ D3 D D D D D D D D D D D D D D D @D LD LD& XD dD lD tD xD D D D DV D` D^ D` D^ D_ Dd De Dh Db D ,D 8D DD HD LD PD TD lD lD pD tD D D D D D| Dx Dl Dp D Dt D D D $D ,D 4D 8D <D @D DD HD LD TD `D dD lD pD D D Di D D D D DD D8D<D@DLDDDDD!D D!D`D'D]D_D` D_$D,,D-DD1TD5\D=hDWpD8xD8|DDDDDDDDDD D,D<DhDpDpDtDxDuD@D'D(DF,@,@,@,@,,ˀ,ـ,@ ,@ -@ -%@ -7 -K@-Y@-l@-y-@----܀ .c.c.@d..@e.D@f.Uc._c.i@d.@e.@f.t|.@ .@ .@ .׀.@$T.c.c/@d/@e/4@f/E@4/V@](/f@hD/t@\t///@  8 X/c/c/@d/@e/@f `/00@ ` 0@,,0'$@0($^09@\0G@\0T@\0b@\0u@]D^D_D^D_ DpD_DpD_ Dp$Dt0Dv<DwHD||DzD}0@_0$0$l0@i0@i0@j0@j0@j0@j0k\DlDDl DD$D(D4D8D<D@DDDHDTDXDdDtDxD>|DCDGDIDKDLDLDMDD D$D0D4D<D@DDDHDPDlDpDtDQ|DXDD_DDDDD8DHDLDPDTDXD`DpDtDxD|DDDDDDDDDDDDDDDDDDD DDDD D$D(D0DlDtDDDDD DKDLDNDODgDiDj Dl(Dr4Ds@DuPDwxD|DDDDDDDDDDD D0D4D8D<DDDHDLDPDhD|DDDDDDDDDDD%D&D5D5D7D8D7D8D8D9D8D:D;$D?,D@LDAXDCD=DJDJDLDJDJDODQDQDSD^D_LD`XDd`DeDfDgDbDnDnDpDnDnDsDuDuDw D<DHDLDPDTDXD\D`D`DhDtDxD|DDDDDDDDDDDDDDDDDDDD D D (D 0D PD \D D D! D! D# D! D! D& D( D) D* DF DG 0DF DDJ TDL `Db hDc Dd De D` D D D D D D D D $D 0D HD TD XD \D `D dD hD lD lD tD D D D D D D D D D D D D D D D D D D D D D D" D# 0D" DDP TDU `D hD lD D D D D D D D D 8D LD `D tDU DX DZ D\ DZ DZ D DD D(DdDDeHDgXDj`DllDjDjDsDuDsDsD|D~D| D|$D8DDDhDlDDDDDDDDD*D-D.,D-DD2\D3pD2D7D8D7D<D=D<DA(DB<DC@DBDDCHDATDGlDHDIDHDIDGDDDDDDDDDDDDDDDD,D4D<DHDLDPDTDTDhDlDlDDDDDDDDDDDD$DDD-DD-HD/TD0`D1dD-D-D4D6D6D8DDDDDDDDDDDDD($D(0D08D6dDHDIDGDHDGDIDHDJDKDLDWD]DfDjDnDoDp(Dp@DlHDqTD|\D|`DhDtDDD~D|D|D_D]D]DO0DQTDQXD>`DA`D>lD@pDBtD@xD?|D@DBDCD#D$D#D$D)D)D*D.D8D.D/D3D8D9D/D4D9D: DBDD(DE,DD0DK4DM8DOXDVdDYlDYxD[D\DaD`DaDaDbDcDRDQDRDRDSDTD=D?D?D(D<D<D@DDDHDLDPDTDXD\D`DdDlDxD|DDDDDDDD DDDDDDDD0D<DXD\DdDhD|D-D-D0D6D?D@DADB(DF4D88D9XD:dDDDDDDDD D D D D D DDDDDD D,D8DLD\DlD|DDDDDDDDDD$D(D,D4DpDDqHDsLDuPDwpDx|DyDzDDDDDDD D0D<D\DhDDDDDDDXDiDk Dr,Dt4DuHDwlDmtDnDnDZD[DZD[D^ DaPDhDhDpDtDDDDDDDD D D! 0D# 4D' 8D! <D# @D' DD# HD" LD! PD" TD# XD$ \D) `D' dD+ hD- D. D/ D0 D5 D6 D7 D9 D7 D D 0@q1@r1@s1@1*@17@1D@1O@1\@1o1@ 1@1@1@1@1@1@1@2@2@2@2-@27@2P@2d@2x@2`2X2@| 2ˀ0< 2$"2$2@2@3 @3@3*@3>@3M\3]`DD/D D'D/DD)D D(D,D 0D#4D$8D&<D)@D/DD0LD1D8D7D:D7D6D:D<D=D?D@DADBDGDIDLDIDJDIDJDI DJDIDLD\DL D]$DX,D\4DX8DT<DS@DTDDSHDLLDSPDTTDVXDW\DV`DWdDPhDLlDNpDOtDPxDZ|DVDWD~DDwD~DDwDDDDDDDDDDDDDDDDDDD,D0D4DXDhDxD|DDDDDDDDDDDDDDDDD$D HD `D dD pD |D D D D eD mD hD D "D 0 D -D .D 0 D 38D ^DD _HD\D @dD FpD HD ND RD UD WD ZD YD ZD YD ZD ^D JD D  DDD\DDDDDDDDD<DHDlDxD|DDDDDDD n3p@3@3@3@ 3@3@3@3߀33 4!4&"|46@#4Q$x4i%4|&t4@'4)p4@*4@< 4@4@\4@4@5@  d5@  5@  5"@5/@5<@   H5F@5S@\5`@  D5j@(5s@,4<5|$5} c5 d5 e5 f5 g6&_6A&c6e&d6&l6&6&7&7K&7p& 7dpcre.c/usr2/SOURCES/S9/pcre-4.5/pcre.cgcc2_compiled.int:t(0,1)=r(0,1);-2147483648;2147483647;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,3);-2147483648;2147483647;unsigned int:t(0,4)=r(0,4);000000000000000000000000;000000000000037777777777;long unsigned int:t(0,5)=r(0,5);000000000000000000000000;000000000000037777777777;long long int:t(0,6)=@s64;r(0,6);001000000000000000000000;000777777777777777777777;long long unsigned int:t(0,7)=@s64;r(0,7);000000000000000000000000;001777777777777777777777;short int:t(0,8)=@s16;r(0,8);-32768;32767;short unsigned int:t(0,9)=@s16;r(0,9);0;65535;signed char:t(0,10)=@s8;r(0,10);-128;127;unsigned char:t(0,11)=@s8;r(0,11);0;255;__int128_t:t(0,12)=@s128;r(0,12);000000000000000000000000;0377777777777777777777777777777777;__uint128_t:t(0,13)=@s128;r(0,13);000000000000000000000000;0377777777777777777777777777777777;float:t(0,14)=r(0,1);4;0;double:t(0,15)=r(0,1);8;0;long double:t(0,16)=r(0,1);16;0;complex int:t(0,17)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,18)=R3;8;0;complex double:t(0,19)=R4;16;0;complex long double:t(0,20)=R5;32;0;__builtin_va_list:t(0,21)=*(0,22)=(0,22)_Bool:t(0,23)=@s8;-16;pcre.cinternal.hconfig.h/usr/include/ctype.h/usr/include/iso/ctype_iso.h/usr/include/sys/feature_tests.h/usr/include/sys/isa_defs.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/limits.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/syslimits.h/usr/include/iso/limits_iso.h/usr/include/sys/int_limits.hclock_t:t(9,1)=(0,3)/usr/include/setjmp.h/usr/include/iso/setjmp_iso.hjmp_buf:t(13,1)=(13,2)=ar(13,3)=r(13,3);000000000000000000000000;000000000000037777777777;;0;11;(0,1)sigjmp_buf:t(12,1)=(12,2)=ar(13,3);0;18;(0,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdarg.h__gnuc_va_list:t(14,1)=(0,21)va_list:t(14,2)=(14,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stddef.hptrdiff_t:t(15,1)=(0,1)size_t:t(15,2)=(0,4)wchar_t:t(15,3)=(0,3)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio.h/usr/include/iso/stdio_iso.h/usr/include/sys/va_list.h__va_list:t(18,1)=(18,2)=*(0,22)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio_tag.h__FILE:t(19,1)=(19,2)=xs__FILE:/usr/include/stdio_impl.hssize_t:t(20,1)=(0,1)__FILE:T(19,2)=s16_cnt:(20,1),0,32;_ptr:(20,2)=*(0,11),32,32;_base:(20,2),64,32;_flag:(0,11),96,8;_file:(0,11),104,8;__orientation:(0,4),112,2;__ionolock:(0,4),114,1;__seekable:(0,4),115,1;__filler:(0,4),116,4;;__longlong_t:t(17,1)=(0,6)FILE:t(17,2)=(19,1)fpos_t:t(17,3)=(0,3)off_t:t(16,1)=(0,3)off64_t:t(16,2)=(17,1)fpos64_t:t(16,3)=(17,1)/usr/include/stdlib.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/iso/stdlib_iso.hdiv_t:t(22,1)=(22,2)=s8quot:(0,1),0,32;rem:(0,1),32,32;;ldiv_t:t(22,3)=(22,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;lldiv_t:t(21,1)=(21,2)=s16quot:(0,6),0,64;rem:(0,6),64,64;;uid_t:t(21,3)=(0,3)/usr/include/string.h/usr/include/iso/string_iso.hpcre.hpcre:t(25,1)=(25,2)=xsreal_pcre:pcre_extra:T(25,3)=s16flags:(0,5),0,32;study_data:(18,2),32,32;match_limit:(0,5),64,32;callout_data:(18,2),96,32;;pcre_extra:t(25,4)=(25,3)pcre_callout_block:T(25,5)=s40version:(0,1),0,32;callout_number:(0,1),32,32;offset_vector:(25,6)=*(0,1),64,32;subject:(25,7)=*(25,8)=k(0,2),96,32;subject_length:(0,1),128,32;start_match:(0,1),160,32;current_position:(0,1),192,32;capture_top:(0,1),224,32;capture_last:(0,1),256,32;callout_data:(18,2),288,32;;pcre_callout_block:t(25,9)=(25,5)BOOL:t(2,1)=(0,1) :T(2,2)=eESC_A:1,ESC_G:2,ESC_B:3,ESC_b:4,ESC_D:5,ESC_d:6,ESC_S:7,ESC_s:8,ESC_W:9,ESC_w:10,ESC_dum1:11,ESC_C:12,ESC_Z:13,ESC_z:14,ESC_E:15,ESC_Q:16,ESC_REF:17,; :T(2,3)=eOP_END:0,OP_SOD:1,OP_SOM:2,OP_NOT_WORD_BOUNDARY:3,OP_WORD_BOUNDARY:4,OP_NOT_DIGIT:5,OP_DIGIT:6,OP_NOT_WHITESPACE:7,OP_WHITESPACE:8,OP_NOT_WORDCHAR:9,OP_WORDCHAR:10,OP_ANY:11,OP_ANYBYTE:12,OP_EODN:13,OP_EOD:14,OP_OPT:15,OP_CIRC:16,OP_DOLL:17,OP_CHARS:18,OP_NOT:19,OP_STAR:20,OP_MINSTAR:21,OP_PLUS:22,OP_MINPLUS:23,OP_QUERY:24,OP_MINQUERY:25,OP_UPTO:26,OP_MINUPTO:27,OP_EXACT:28,OP_NOTSTAR:29,OP_NOTMINSTAR:30,OP_NOTPLUS:31,OP_NOTMINPLUS:32,OP_NOTQUERY:33,OP_NOTMINQUERY:34,OP_NOTUPTO:35,OP_NOTMINUPTO:36,OP_NOTEXACT:37,OP_TYPESTAR:38,OP_TYPEMINSTAR:39,OP_TYPEPLUS:40,OP_TYPEMINPLUS:41,OP_TYPEQUERY:42,OP_TYPEMINQUERY:43,OP_TYPEUPTO:44,OP_TYPEMINUPTO:45,OP_TYPEEXACT:46,OP_CRSTAR:47,OP_CRMINSTAR:48,OP_CRPLUS:49,OP_CRMINPLUS:50,OP_CRQUERY:51,OP_CRMINQUERY:52,OP_CRRANGE:53,OP_CRMINRANGE:54,OP_CLASS:55,OP_NCLASS:56,OP_XCLASS:57,OP_REF:58,OP_RECURSE:59,OP_CALLOUT:60,OP_ALT:61,OP_KET:62,OP_KETRMAX:63,OP_KETRMIN:64,OP_ASSERT:65,OP_ASSERT_NOT:66,OP_ASSERTBACK:67,OP_ASSERTBACK_NOT:68,OP_REVERSE:69,OP_ONCE:70,OP_COND:71,OP_CREF:72,OP_BRAZERO:73,OP_BRAMINZERO:74,\OP_BRANUMBER:75,OP_BRA:76,;uschar:t(2,4)=(0,11)real_pcre:T(25,2)=s28magic_number:(0,5),0,32;size:(15,2),32,32;tables:(2,5)=*(2,6)=k(0,11),64,32;options:(0,5),96,32;top_bracket:(0,9),128,16;top_backref:(0,9),144,16;first_byte:(0,9),160,16;req_byte:(0,9),176,16;name_entry_size:(0,9),192,16;name_count:(0,9),208,16;;real_pcre:t(2,7)=(25,2)pcre_study_data:T(2,8)=s40size:(15,2),0,32;options:(2,4),32,8;start_bits:(2,9)=ar(13,3);0;31;(2,4),40,256;;pcre_study_data:t(2,10)=(2,8)compile_data:T(2,11)=s44lcc:(2,12)=*(2,13)=k(2,4),0,32;fcc:(2,12),32,32;cbits:(2,12),64,32;ctypes:(2,12),96,32;start_code:(2,12),128,32;name_table:(2,14)=*(2,4),160,32;names_found:(0,1),192,32;name_entry_size:(0,1),224,32;top_backref:(0,1),256,32;backref_map:(0,4),288,32;req_varyopt:(0,1),320,32;;compile_data:t(2,15)=(2,11)branch_chain:T(2,16)=s8outer:(2,17)=*(2,16),0,32;current:(2,14),32,32;;branch_chain:t(2,18)=(2,16)recursion_info:T(2,19)=s24prevrec:(2,20)=*(2,19),0,32;group_num:(0,1),32,32;after_call:(2,12),64,32;save_start:(2,12),96,32;offset_save:(25,6),128,32;saved_max:(0,1),160,32;;recursion_info:t(2,21)=(2,19)match_data:T(2,22)=s96match_call_count:(0,5),0,32;match_limit:(0,5),32,32;offset_vector:(25,6),64,32;offset_end:(0,1),96,32;offset_max:(0,1),128,32;lcc:(2,12),160,32;ctypes:(2,12),192,32;offset_overflow:(2,1),224,32;notbol:(2,1),256,32;noteol:(2,1),288,32;utf8:(2,1),320,32;endonly:(2,1),352,32;notempty:(2,1),384,32;start_code:(2,12),416,32;start_subject:(2,12),448,32;end_subject:(2,12),480,32;start_match:(2,12),512,32;end_match_ptr:(2,12),544,32;end_offset_top:(0,1),576,32;capture_last:(0,1),608,32;start_offset:(0,1),640,32;recursive:(2,23)=*(2,21),672,32;callout_data:(18,2),704,32;thisframe:(2,24)=*(2,25)=xsheapframe:,736,32;;match_data:t(2,26)=(2,22)eptrblock:T(1,1)=s8epb_prev:(1,2)=*(1,1),0,32;epb_saved_eptr:(2,12),32,32;;eptrblock:t(1,3)=(1,1)chartables.cpcre_version:F(25,7)pcre_info:F(0,1)external_re:P(1,4)=*(1,5)=k(25,1)optptr:P(25,6)first_byte:P(25,6)pcre_fullinfo:F(0,1)external_re:P(1,4)extra_data:P(1,6)=*(1,7)=k(25,4)what:P(0,1)where:P(18,2)study:r(1,8)=*(1,9)=k(2,10)pcre_config:F(0,1)what:P(0,1)where:P(18,2)check_escape:f(0,1)ptrptr:P(1,10)=*(2,12)errorptr:P(1,11)=*(25,7)bracount:P(0,1)options:P(0,1)isclass:P(2,1)ptr:r(2,12)c:r(0,1)i:r(0,1)oldptr:r(2,12)oldptr:r(2,12)cc:r(0,1)cc:r(0,1)is_counted_repeat:f(2,1)p:P(2,12)read_repeat_counts:f(2,12)p:P(2,12)minp:P(25,6)maxp:P(25,6)errorptr:P(1,11)min:r(0,1)max:r(0,1)first_significant_code:f(2,12)code:P(2,12)options:P(25,6)optbit:P(0,1)find_fixedlength:f(0,1)code:P(2,14)options:P(0,1)length:r(0,1)branchlength:r(0,1)cc:r(2,14)d:r(0,1)op:r(0,1)find_bracket:f(2,12)code:P(2,12)utf8:P(2,1)number:P(0,1)c:r(0,1)n:r(0,1)find_recurse:f(2,12)code:P(2,12)utf8:P(2,1)c:r(0,1)could_be_empty_branch:f(2,1)code:P(2,12)endcode:P(2,12)utf8:P(2,1)c:r(0,1)ccode:r(2,12)empty_branch:r(2,1)ccode:r(2,12)empty_branch:r(2,1)could_be_empty:f(2,1)code:P(2,12)endcode:P(2,12)bcptr:P(1,12)=*(2,18)utf8:P(2,1)check_posix_syntax:f(2,1)ptr:P(2,12)endptr:P(1,10)cd:P(1,13)=*(2,15)terminator:r(0,1)check_posix_name:f(0,1)ptr:P(2,12)len:P(0,1)yield:r(0,1)adjust_recurse:f(0,22)group:P(2,14)adjust:P(0,1)utf8:P(2,1)cd:P(1,13)ptr:r(2,14)offset:r(0,1)offset:r(0,1)compile_branch:f(2,1)optionsptr:p(25,6)brackets:p(25,6)codeptr:p(1,14)=*(2,14)ptrptr:p(1,10)errorptr:p(1,11)firstbyteptr:p(25,6)reqbyteptr:p(25,6)bcptr:p(1,12)cd:p(1,13)reqbyteptr:r(25,6)cd:r(1,13)repeat_type:r(0,1)op_type:r(0,1)repeat_min:(0,1)repeat_max:(0,1)bravalue:(0,1)length:r(0,1)greedy_default:(0,1)greedy_non_default:(0,1)firstbyte:r(0,1)reqbyte:r(0,1)zeroreqbyte:r(0,1)zerofirstbyte:(0,1)req_caseopt:(0,1)reqvary:(0,1)tempreqvary:r(0,1)condcount:r(0,1)options:r(0,1)c:r(0,1)code:r(2,14)tempcode:(2,14)inescq:r(2,1)groupsetfirstbyte:(2,1)ptr:(2,12)tempptr:(2,12)previous:r(2,14)class:(2,9)negate_class:(2,1)possessive_quantifier:(2,1)class_charcount:r(0,1)class_lastchar:r(0,1)newoptions:(0,1)recno:r(0,1)skipbytes:(0,1)subreqbyte:(0,1)subfirstbyte:(0,1)negate_class:(2,1)possessive_quantifier:(2,1)class_charcount:r(0,1)class_lastchar:r(0,1)newoptions:(0,1)recno:r(0,1)skipbytes:(0,1)subreqbyte:(0,1)subfirstbyte:(0,1)tc:r(2,14)negate_class:(2,1)possessive_quantifier:(2,1)class_charcount:r(0,1)class_lastchar:r(0,1)newoptions:(0,1)recno:r(0,1)skipbytes:(0,1)subreqbyte:(0,1)subfirstbyte:(0,1)tc:r(2,14)set:(0,1)unset:(0,1)optset:r(25,6)negate_class:(2,1)possessive_quantifier:(2,1)class_charcount:r(0,1)class_lastchar:r(0,1)newoptions:(0,1)recno:r(0,1)skipbytes:(0,1)subreqbyte:(0,1)subfirstbyte:(0,1)set:(0,1)unset:(0,1)optset:r(25,6)condref:r(0,1)n:r(0,1)called:r(2,12)number:r(0,1)set:(0,1)unset:(0,1)optset:r(25,6)called:r(2,12)n:r(0,1)n:r(0,1)n:r(0,1)i:r(0,1)namelen:r(0,1)type:r(0,1)name:r(2,12)slot:r(2,14)i:r(0,1)namelen:r(0,1)slot:r(2,14)crc:r(0,1)crc:r(0,1)crc:r(0,1)len:r(0,1)len:r(0,1)i:r(0,1)ketoffset:(0,1)len:r(0,1)bralink:r(2,14)i:r(0,1)ketoffset:(0,1)len:r(0,1)bralink:r(2,14)i:r(0,1)ketoffset:(0,1)len:r(0,1)bralink:r(2,14)offset:r(0,1)oldlinkoffset:r(0,1)offset:r(0,1)bra:r(2,14)oldlinkoffset:r(0,1)offset:r(0,1)bra:r(2,14)offset:r(0,1)ket:r(2,14)d:r(0,1)uc:r(0,1)cbits:r(2,12)local_negate:(2,1)posix_class:r(0,1)i:r(0,1)cbits:r(2,12)taboffset:r(0,1)taboffset:r(0,1)number:r(0,1)compile_regex:f(2,1)options:p(0,1)oldims:P(0,1)brackets:P(25,6)codeptr:p(1,14)ptrptr:P(1,10)errorptr:P(1,11)lookbehind:p(2,1)skipbytes:p(0,1)firstbyteptr:p(25,6)reqbyteptr:p(25,6)bcptr:p(1,12)cd:p(1,13)lookbehind:r(2,1)skipbytes:r(0,1)firstbyteptr:r(25,6)reqbyteptr:r(25,6)bcptr:r(1,12)cd:r(1,13)ptr:(2,12)code:(2,14)last_branch:r(2,14)reverse_count:r(2,14)firstbyte:r(0,1)reqbyte:r(0,1)branchfirstbyte:(0,1)branchreqbyte:(0,1)bc:(2,18)length:r(0,1)prev_length:r(0,1)prev_length:r(0,1)length:r(0,1)is_anchored:f(2,1)code:P(2,12)options:P(25,6)bracket_map:P(0,4)backref_map:P(0,4)scode:r(2,12)op:r(0,1)new_map:r(0,1)scode:r(2,12)op:r(0,1)scode:r(2,12)op:r(0,1)is_startline:f(2,1)code:P(2,12)bracket_map:P(0,4)backref_map:P(0,4)scode:r(2,12)op:r(0,1)new_map:r(0,1)scode:r(2,12)op:r(0,1)scode:r(2,12)op:r(0,1)find_firstassertedchar:f(0,1)code:P(2,12)options:P(25,6)inassert:P(2,1)c:r(0,1)d:r(0,1)scode:r(2,12)op:r(0,1)d:r(0,1)scode:r(2,12)op:r(0,1)d:r(0,1)scode:r(2,12)op:r(0,1)pcre_compile:F(1,15)=*(25,1)pattern:P(25,7)options:P(0,1)errorptr:P(1,11)erroroffset:P(25,6)tables:P(2,5)re:r(1,16)=*(2,7)length:r(0,1)runlength:r(0,1)c:r(0,1)firstbyte:(0,1)reqbyte:(0,1)bracount:(0,1)branch_extra:r(0,1)branch_newextra:r(0,1)item_count:r(0,1)name_count:r(0,1)max_name_size:(0,1)inescq:r(2,1)brastackptr:r(0,4)size:r(15,2)code:(2,14)codestart:r(2,12)ptr:(2,12)compile_block:(2,15)brastack:(1,17)=ar(13,3);0;199;(0,1)bralenstack:(1,18)=ar(13,3);0;199;(2,4)min:(0,1)max:(0,1)class_optcount:r(0,1)bracket_length:r(0,1)duplength:r(0,1)min:(0,1)max:(0,1)class_optcount:r(0,1)bracket_length:r(0,1)duplength:r(0,1)temp_options:(0,1)ch:r(0,1)ch:r(0,1)ch:r(0,1)temp_options:(0,1)ch:r(0,1)min:(0,1)max:(0,1)class_optcount:r(0,1)bracket_length:r(0,1)duplength:r(0,1)save_ptr:r(2,12)saveptr:r(2,12)refnum:r(0,1)refnum:r(0,1)set:(0,1)unset:(0,1)optset:r(25,6)min:(0,1)max:(0,1)class_optcount:r(0,1)bracket_length:r(0,1)duplength:r(0,1)set:(0,1)unset:(0,1)optset:r(25,6)ch:r(0,1)match_ref:f(2,1)offset:P(0,1)eptr:P(2,12)length:P(0,1)md:P(1,19)=*(2,26)ims:P(0,5)p:r(2,12)match:f(0,1)eptr:P(2,12)ecode:P(2,12)offset_top:P(0,1)md:P(1,19)ims:P(0,5)eptrb:P(1,20)=*(1,3)flags:p(0,1)rrc:r(0,1)i:r(0,1)c:r(0,1)callpat:r(2,12)data:r(2,12)next:r(2,12)pp:r(2,12)prev:r(2,12)saved_eptr:r(2,12)new_recursive:(2,21)cur_is_word:r(2,1)condition:r(2,1)minimize:r(2,1)prev_is_word:r(2,1)original_ims:r(0,5)ctype:r(0,1)length:r(0,1)max:r(0,1)min:r(0,1)number:r(0,1)offset:r(0,1)op:r(0,1)save_capture_last:r(0,1)save_offset1:r(0,1)save_offset2:r(0,1)save_offset3:r(0,1)stacksave:(1,21)=ar(13,3);0;29;(0,1)newptrb:(1,3)slen:r(0,1)cb:(25,9)pcre_exec:F(0,1)external_re:P(1,4)extra_data:P(1,6)subject:P(25,7)length:P(0,1)start_offset:P(0,1)options:P(0,1)offsets:p(25,6)offsetcount:p(0,1)offsets:r(25,6)offsetcount:r(0,1)rc:r(0,1)resetcount:r(0,1)ocount:r(0,1)first_byte:r(0,1)req_byte:r(0,1)req_byte2:(0,1)ims:(0,5)using_temporary_offsets:(2,1)anchored:(2,1)startline:(2,1)first_byte_caseless:r(2,1)req_byte_caseless:(2,1)match_block:(2,26)start_bits:(2,12)start_match:r(2,12)req_byte_ptr:(2,12)study:r(1,8)flags:r(0,4)iptr:r(25,6)iend:r(25,6)iptr:r(25,6)iend:r(25,6)p:r(2,12)pp:r(0,1)pp:r(0,1)iptr:r(25,6)iend:r(25,6)p:r(2,12)iptr:r(25,6)iend:r(25,6)p:r(2,12)c:r(0,1)c:r(0,1)pcre_malloc:G(1,22)=*(1,23)=f(18,2)pcre_free:G(1,24)=*(1,25)=f(0,22)pcre_stack_malloc:G(1,22)pcre_stack_free:G(1,24)pcre_callout:G(1,26)=*(1,27)=f(0,1)OP_lengths:S(1,28)=ar(13,3);0;76;(2,13)rep_min:S(1,29)=ar(13,3);0;5;(25,8)rep_max:S(1,30)=ar(13,3);0;5;(25,8)escapes:S(1,31)=ar(13,3);0;74;(1,32)=k(0,8)posix_names:S(1,33)=ar(13,3);0;13;(1,34)=k(25,7)posix_name_lengths:S(1,35)=ar(13,3);0;14;(2,13)posix_class_maps:S(1,36)=ar(13,3);0;41;(1,37)=k(0,1)digitab:S(1,38)=ar(13,3);0;255;(2,6)pcre_default_tables:S(1,39)=ar(13,3);0;1087;(0,11) `^h,8hCXUhMsDd dh8| ,@X7@( 5hO\"p4P<XDU \d@0wN 4020:X@|q  $.3@ PU[pcre.cfind_recurseescapescould_be_emptyfind_firstassertedcharis_counted_repeatcheck_posix_syntaxOP_lengthscould_be_empty_branchfind_bracketposix_namesposix_name_lengthscompile_branchpcre_default_tablesdigitabis_startlinecheck_posix_namecheck_escapeis_anchoredmatchfirst_significant_coderep_minrep_maxposix_class_mapsadjust_recurseread_repeat_countsmatch_reffind_fixedlengthcompile_regexpcre_compilepcre_config.divpcre_execpcre_versionstrncmppcre_infomemcmpmemcpymemmovepcre_stack_mallocmallocpcre_fullinfopcre_freefreepcre_calloutpcre_stack_free.rem.umulpcre_malloc X X  0<DL| 0 4 D\P\dp p p ^ ^ 4 4, 0  X Xp x    X X4<8<@DHLPTX\`dhlptx|,,,,,\  $,(,04,8<@DH,LPT\ X` X XL XT X X  T (X (            $  (  ,  0  4  8  <  @ D  H  L  P  T  X  \  `  d  h  l  p  t  x  |                                                                                $ (  ,  0 ` 0 h 0 8  <         $ ( L , L 0 4 8 < @ D H L P T X \ ` d h l p t x |                                            $ ( , 0 4 8 < @ D H x L x P T X \ ` x d h     ( 0 4 \ ` pp  $(,048<@DHLPTX\`dhlptx|DD    h h)\ 0` 0$ H( H X  XP /T / X Xx |  X X    D XT X  X)  X+,6- $ 4-!-"\,#-#t,# @# @$4-$ h$ h&,( ( ( /( /* *$ +(  +0 +4 +D++H  , , ,, ,4 ,l (,| (/(/(/),/)h/)/)//0/d/0/0000000 0000000000 00$00(0,0004080<0@0D0H0L0P0T00X0\ 0`,0d00h00l00p00t80x00|00000000000000000000000000t0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1 ,1,1,1,1,1 ,1$,1(,1,,10,14,18,1<,1@,1D1H,1L,1P,1T1Xt1\1`$1d,1h,1l$1p,1t,1x,1|,1,1,1,1,1,1,1,1,1,1,1,1,1$1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2 ,2,2,2,2,2 $2$,2(,2,/420,24,28,2<,2@,2D,2H,2L,2P,2T,2X,2\,2`,2d,2h,2l,2p,2t,2x,2|,2,2,2,2,2,2,2,2,2/T2t5  `5< `5@ 5D 8 9l8 9l9l89p89t89x89|8989898989899(9898989898989898989898989898989898989898989898989898:8:8:8: 8:8:8:8:8: 8:$8:(90:,8:08:48:88:<90:@90:D8:H8:L8:P8:T90: : : ;T ;d6;l7 ;p7 ; ; ;6$ >@ M4>D M4AP hAT hAx LlA| LlA A B XB XB| B B B C XC XCH C6D6D,6D D D E  XE XED 0EL 0E PE PE hE hFX K,F\ K,GT G\ G I I$ K K  K K K K,FK0GTK4GTK8GTK<GK@GTKDGTKHGTKLGTKPGTKTGTKXGTK\GTK`GTKdGTKhGTKlGTKpFKtGTKxGTK|GTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKGTKG$KGTKGTKG0KGTKGTKGTKGTKGTLGTLGTLGTL GTLGTLGTLGTLGTL GTL$GTL(GTL,FlL0GTL4GTL8GTL<G<L@GTLDGTLHGTLLGTLPGTLTGHLXGTL\GTL`GTLdGTLhG`LlELpF(LtALxF(L|F(LF(LF(LBLF(LF(LF(LF(LF(LF(LF(LCLCLCLCLCLCLCLCLCLCLELF(LDLELELF(LF(LF(LF(LELF(LF(MF(MF(MF(M F(MF(MF(MF(MF(M F(M$F(M(EPM,F(M0GlM4IM8>M<>M@>MD@MHGxMLGMPGMT>MX>M\IM`>Md>Mh>Ml>Mp>Mt>Mx>M|>M>M>M>M>M>M>M>M>MGM>M>M>M>M>M>M>M>M>M>M>M>M>M>M>M>M>M>M>M>M>M>M>N>N>N>N >NGN>TN>NIN >N$>N(>N,>N0>N4>N8>N<>N@>ND>NH>NL>NP>NT>NX>N\>N`>Nd>Nh>Nl>Np>Nt>Nx>N|>N>N>N>N>NINJO pO pP-T XT XT PT PW XW XW PW PZ XZ X[ P[ P[\ p[` p\  ph\$ ph\ pH] pHcD XcH XcT Pc\ Pe Xe Xe Pe Pf|,f,g1 g1 gH1 gL1 g`7 gd7 g3 g3 i,pH]pL^pP^LpT^pX^p\_$p`]pd]ph\dpl\xpp\pt\px\p|\p\4p\\p_tp_p_p`@p`p`p[pp_lpP\pPpPpQ pQ pQpQpQpRpR<pRdpRpRpRpSpSpS pS`pSpT|pTpTqTqTqTq TqWqWqWqWq Wq$Wq(Wq,Wq0Wq4Zq8Zq<Zq@ZqDZqHZqLZqPZqTZqXa q\a q`a8qdcxqhcxqlcxqpcxqtcxqxcxq|cxqcxqaTqaTqcxqcqfqgqhqhDqhDqhDqjXqkqjXqkqkxqkqmLqi$qnqo(qi$qPr6sh5s&s7 s&u1 u1 vx1 v|1 v,xT7 hlptx| (08@HPX`/2/ 2 (*0$% hX @<p 4 d D |E2Kt5MH7@O8hQ$fNgO\'PX^hXxas: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.24z xyH hP$  *73Th $;WgCZP4, N| [$0 fT q\07070100005911000081a40000000a0000000a00000001402cbcba000002c20000008800000005000000000000000000000015ff350889reloc/lib/libpcre.la# libpcre.la - a libtool library file # Generated by ltmain.sh - GNU libtool 1.4.3 (1.922.2.110 2002/10/23 01:39:54) # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='libpcre.so.0' # Names of this library. library_names='libpcre.so.0.0.1 libpcre.so.0 libpcre.so' # The name of the static archive. old_library='libpcre.a' # Libraries that this one depends upon. dependency_libs='' # Version information for libpcre. current=0 age=0 revision=1 # Is this an already installed library? installed=yes # Files to dlopen/dlpreopen dlopen='' dlpreopen='' # Directory that this library needs to be installed in: libdir='/usr/local/lib' 07070100005912000081a40000000a0000000a00000001402cbcba00020618000000880000000500000000000000000000001bff350889reloc/lib/libpcre.so.0.0.1ELF4X4 ($(++  !"$'(* #%&) 4 $4 =I PT Z` jrXl    X, , 0$  "*1CL NS]  u@ x    h 8 strncmpmemcmppcre_free_substringpcre_free_substring_listpcre_malloc_etextpcre_info.umulpcre_exectolowerpcre_copy_substring_PROCEDURE_LINKAGE_TABLE__edata_GLOBAL_OFFSET_TABLE_memcpymemsetmallocpcre_fullinfopcre_compilepcre_get_substringpcre_version.rem__ctypememmovetoupperstrcmppcre_stack_mallocpcre_studyfreepcre_freepcre_get_substring_listpcre_copy_named_substringpcre_configpcre_maketables_DYNAMIC_endpcre_calloutstrchrpcre_get_stringnumber.divpcre_stack_freepcre_get_named_substringlibc.so.1SYSVABI_1.3libc.so.1libpcre.so.0/usr/local/lib:/usr/local/ssl/lib7̳hlptx| (08@Hhx 8pX 0@ $(X,0488<@hDH`L8PTX\`dPhpl@ptx|FhP8@`% &(4@L'X dp|(㿐/e<`$@@@ @e ,@ ``!` `Ӣ`@e{  , !@@eu` `   ``> 0`8`@`@` *@   (`(`@ ``> 0`8`@``` *@   (`(`` ` _> 0`8`@`` *@   (`(`"  ` `> 0`8` @ *@  ,@ `2m> ``W> 0`8`@` *@  (` `W`> 0`8`@` *@  (` `` > 0`8`@a *@  (a ` "  > 0`8`@a  *@  (a   $ `%`a@   `2  ``2 `2 `2 ` _@ `? 2 @dʒ 2 ,@  ܢ`0`8`@`  *@  (`  x* @d0 㿀  @d쀢 3쀠`0?  @d耢 (  @d䀢 !쀠` @0`@ 8`@d@@d  " @$' 쀠@4? (`@ 㿐.@6  ?@  @ @ ?`@@dd/㿐\@d[ @dY㿐/c㸦 @  ,`@@``#@ @ ``@@? . &@`$ ,`@@`$  @d $`@.$㿐/c`@@㿐/c┳.`@6  ?  @# ?@c@ .'㿐@c߰ @cޗ㿐/c`@@:`3`@ ;` ` **  @ `  @ 0` `*@* 㿈/c    K  A`? ^`F(`ac % @   (`@  `="  `2   (`@ `="נ F   @ @ `@3 .@ $    @ @ `@@ .@ $    @ @ 3 .@ $    @ @ @ .@ $    @ @ `3 .@ $    @ @ `@ .@ $    `  ]  V  N `   `8 (`ac(% @ ͂   @ @ `@3 .@ $ n   @ @ `@@ .@ $ a   @ @ 3 .@ $ U   @ @ @ .@ $ I   @ @ `3 .@ $ <   @ @ `@ .@ $ /   B @ @ .@ $@  :0`8` `"  *`":`;`0`@8`@ `*  .@`?: р`8 (`acH% @   (`@ `  @ @ .@ $@  " `?.`.`.`.`.`.`.`.`    '  (`@  `="    DtDt ((HXXPPXXp LLL<?.`b%@ b@#@0 #@ @"@`?8  `   @?ڂ ׂ $@LT\㿐/`jL ?.`aܸ%@&@   &@ &%b 㿐/`EḘ   ` `?ЀJ8"`@WH "8h@_c+%@`&@ `/`78   . @ `/`7( ְ & ` ``    @.  @@@Ѐ     @    ` 7?И?   ?`  -&@`(? @@"%"`$  ``""  ``4. `@@аɀy `2 "lllllllll```````````````````````````````````` `````````````````x㿐/_P   @`3  @` `}  @`2  `}" `,  `}    @`  @` `}  @`2  `}`?㿐/_  `? +`@ @@  Ђ `}"  `}`  +  @ @@ `(?c@    @"&@`,&&㿐/^® `H$(`^b%@$  @@@2&@   (`@=" ` ڰܝ㿐/^K ?   K4 LLM*]cĘ% @  b  (`@ `="   ޠ O?  `հ`   (`@ ͠ ! р`8Ơ (`]c% @     (`@ +`@ @'?  !?` @? `=    (`@ =" ` tttt88\TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT\\\\@@TT@㿐/]y`` ``L `@  (`@@ 0 @  `@㿐/]T`` `;``L$    @㿐/]7တ  o (K.  (`@ F  "  (`@ `= 7  ` @  I ܰ( ̔ 2  ;*\c% @  !р` !(`]`% @  ` `(`@ ј 0  ,,,, 8888㿐 V       ^"  ` @   `2  @ "   `]2 "@  㿐/\Z   @` ` @@ ,   @`@ ? @\а 2㿐 (`@ @@* @8`* *  ђ 2 'D6 `'?/\'P''H'T'X!'L'' d' ' '''??''  @@ @ | @` #`'- |8rT", % @ XL @P\" @#"  ,ȸ '|`' ``?'x L'H`M`'`" K, ';`,  'x, ,``x#`#l@ #p#\| (H#hT'#d@Ȁ [ GA'`K''  F`? G`A @`)`dT"P #@` ``6@'`? '?'  (`@  `>   ?''Ȃ`` E4 `' ߀`18ȗ(`TcL% @ Ȣ`'``)/ ' @`)(` B'Ȣ`'Ș G'  R2` @ V'Ș ' `)ȃ* @`' `@ )@@ Ѐ Ȣ` H',,:, 2'x`LTi#? H,,,Ț `'x ' ` @ `   *'Ȃ@ @@ @ `Ѐ),  "  (`@ "` ;, $ ;`, $,  ;`\T @`X   נ L'`Ȣ`'``! `=D` C'B'` D'=' A[' F' <,`Т`' ` `  ȃ* @`' `@ @ @`@ Ѐ,ȦW i`PȢ`' `` <JÂ```'  `) `' @`) $@ @ 6Ȓ @Z    `@ `X@  >  (`U@ , ::,, $ (@   % $% Ȣ` '@``>' $@ @ :@Zq ``*? &   `@ H@`8`,H``@ZD,+` `%  @Z4"@ZGH`Tޢ'' @ `) `:@ @  `iY'Ȁ`iD`s`U"?@7`X`-" @ ` `) `:@ @  @ `)+@ '|` L''  @  ,,Ȧ|D6  `+``"''' j @`@"@b`s`x`m@`@`@`@`Ȣ`l''Ė?' Ā`' `@ @ '+` +' ?`;r ` [ V 8qɠ " (Ā`60-,8`,,,  (Ȃ@ % ($@Y|  F(@ >, < ,,(`+`,ݦ`,Ħ8`,,&,Āʘ,Ė#@',ނ``d"  `/ `` :`  ``?@3 K- Ă``$`?`5 "3,Ħ8`,,:,,' {,倠`1/x   F`?  G'p$  Ā`i`瀢U  , I @Xؔ/ L / //  '6 I L,  ,'$,8`,@X?# >$`$  (`@ " $,; ,,**ۂ p$?+@  , I@X/ 6`2  " @XZĠ    (`@  `>2 $ o'pM`H     / 'Ā` ( @ @X<  L/$ >/ ;`/ ,,,`y'Ȣ` 'ȴ s'`D S'Ā"? ,ȸ'''G  `:.`?`? ׸=Ր`'` ^'  ????? '`v [ \kȃ< 0`8`   *   ( @4  ? *@+?'`'` ]܀`݀ \""?'`' 8 , 8,  $*  7, @W  '"? ,',0Ȁ  (' @  , ,?@ ' `E<   'Ȁ \GH ``-<  ``]`' @ \*H#4Ȗ  < 0`8` *   (  @0` ?`*@+?' t`@TȖY  Ҁ?ΐ G'T@ȖJ ?y?j Ȃ  `Z (`Tcd% @   `@ @ *9Ƞ  `@ 3 *,Ƞ   3 (Ȃ`/Ѡ   @ (  ` 3 *Ƞ  ` @ *Ȁ @M @L`< ``\" ` `E2 6`  `:.`?`? =- \ & \'t ` `:]`' ``^"S`̐"@ H    ` @?5  Ȑ@* @ @Vn @`? t`  3 *`"`т`(@#8`+ #@(`D`@' `)" *d @P  @Th#@= @*܂'ܐ(@ D : ,,? T'@ܰ !#@؀@  &?` ` =}@2?`䀠`6 = 'T㿐 \  L"   (`@  (@   <   (`@ `=ݒ1 LA`?`?  FG`?`? ڒޔ`@`  ` "  `( @0` `@ @ Ȃ 㿐   L!   (`@  (@ @`  -   (`@ `="ޔ " LA`?`?  FG`?`? ߒ`  ` @"  ׂ 㿐/R}☠?   K4 L:*Ra% @ ,? (? &@ !  (`@ `=۔ ` ! Aǔ`? ? 〤 PHHHTTHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHĝ0/R'  ? ' '@ 9&&h`t?a@, ' !"#@''''Ԁ '''̀ 퀎`Ӗ? `̀ #Ԃ`'`  @`@R9`@ @ & & bE 6 'ܑ,`'&& 6 'ؓ/`2 @R2` L'''',Ԃ#p'#\#`#l`#d#h6   6 @``&(@` @@'`&  @(`X&`L`"` aba`@ @ "   6 & ~'  `& &! @@"  6 @  'Q " `@@Ԃ$@ X&` R&`9?܀X`*MaX% @ ԐԒ `ހ K \'Ԧ  \Ԥ̢`'`K@` 4 ' ``E2` 'Ԁ` \ `Ԁ # \Ԓj ` 6'Ԣ`'` ƀ À?F?Ѧ   (@@`'4' ``{3` ԒА j`l'Ѐ ̚` 8`?`? 2 ̦ ``?`'Ԁ2 Ԟ ` `?!@ ``' ` @ ({ԃ+ @   |h'`$& `?߀185*Mb % @ `' `)@ @  ' @`)@ @  @`2Bւ` ``R"9 ` ` `'  `  ' @ ` @`)`' ``? ` = !@ @  <``&'Ԁ`)`'Ԣ` R 'Ԃ`Т '  ` @`)] `?ւ`` ?`  ``?@ {ڂ ` {6 *1 ++ ?# ''Ѐ ?̀ ?@P ``+`"@Ò@ @@O?'Ж `''Ԃ '?'` ԒА J`'K$@#``'  `=`!`? `?`}```'Ԣ`' ` `2Ԁ`)i``' `<Â``̚`' ` `2`)``'   ` ' @ ` @`>$@@ `''''Ȕ @?׀OC*Mc`% @ `"`'Ԁ` Ă@'IJ(@ 'Ȫ?Ě@` )` @ ) `? `?@ 2 הӂbЂ`@͂`ʂ`y`Ă``'`' {ԃ+`@ |$   Ԣ`' ``^  @`M S @`\"I ` `'``> 2 @`] `6 " ``{!` ԒА H`J'Ѐ ̚` 8`?`? 2 ̦ ``+ހ`?`2`|`E2 ` 'Ԁ`\`[2  "Ԡ `ԒϘ `?" ?   `'9  "ԒА `'Ѐ ̂8 `?`? 2 $ ``?R`+`M'ԀԂ`Ԣ`'`  2``x`pDl, xlttttttttttx8xx h0|| | 㿐. @<8 @@% @  `  ` @ @` ` /L럮 @ `?I&\`','X'\X@ L $```(`@ ` LL*Da|% @  #\`˚ ``(`@ @@`= 0`T`"`0``2`0@```%`T@L*` ,%`@``"%`H`@ %`H%`D `8  ``8`P @`8 ?` `2 `<  ` `2  ``@"@Ȕ @2@Ô `<  `  ̀``<  `  `2n`0`<  `  ``<  `  뀈``<  `  ``<  `  ׀`  `<  ` {   0u`<`< o 2-` ` ")`0g`< y 0b` `` ``8 Y h "`? c` " `$`< :`$ W``A `,``< 92` ` "`01``<`"+  ?`@ @ @   ` ?@Ր?@ @` ?@`<   `  `@ @ @`@2@0@ @`` `K K@` c`<"ݔ @ R``  @ @  Ͱ `@$#\i @ `<`  @ `0    `@   #\=? :  @   `@$9#\ l@j `<f` 0`   `@  P #\? D:@ ``(` @ ` `U`?``(``@ N` `K K@` c`<" @ R`` @     `@$À#\ @ `<`  @ `0瀤    `@  ֔ #\{ ?:Ŕ  @   `@$u#\X @ `<` 0   `@   #\1 ?:{ ``(` @ `$ `T`?``(``@ M` ڂ`K K@` c`<@"@`R 8*Da% @  2 @  ` 9 `@$򀥠M#\Ԛ $@6" `<9 *Da% @   `?7 ``@  ڢ`` @`` @`2Ϣ`0` @퀈`` @`` @〈`` @뀈` *Daܘ% @  $%   ` `@  ǔ #\k? : %"@4 〦` @ ݀`@ ׀Ӣ р` @ ˀ`@ ŀ ` @ `@  ` @ `@  ` @ `@  ` @ `@ } @ ` `7 `@$ @` `& `@$ @ꀤ` ` `@$݀ @ـ` ` `@$̀ @Ȁ` ` `@$ @` ` `@$``(` @ `- `?z```(` @ ``!@ /t 4$t 6o ``````6+ `?+`@  c` @`<  4   ;@ ` `@ V#\9 @6 `< `4   ;@ ` y w `< 4   ;@ ``@  a #\? U:Q   `?K@` K@` c=?``(`@ @``(`@&`<@ `#@ @ /p 4$y 6k``````6+ `?+`@  c`"@ @DȀ#\ @ o `   #\ &:ה M 怦`@>  `@/  @n`?K@` K@` c`<"p````4+`@  `'  (`@ '`T` 'ؤز`'쀢 %`TD'`'`@GO*`@`'%`@ #\   e`*@G6%`T  (`@  `="#\ؚ` %`T`@@I ؂`%`T@> `@@* ? '02`@ "``8`<'0 @ ``L``X`@'@& 'H68`'8'T#@ '4'P'D'<'L0  6Ͳ`0 ``(`@ @@="`Ö ```(`@ &@ ?`` F`  ``?@q@ G?  (`@ `Q%`L %``T "@ @"<@ >`? `?,`@ #\i `#\^ " 0`#\R  #\  ` %`T%`@@Fh* O,`` `8 @(`.# & @ #`%`H%`D|  #\`  "@ m``(`@ @@="#\ `>` \`\ ``(`@ @@`="``H #\` E B``(`@ @@`=\`n 03```8(`@ & d 0) #\`̚ "@ ``(`@ @@="#\ `F `=@ @  ``(`@ @@="``D>`? `?,`H``"/`@ #\ `#\ "֔ 0Ԕ`#\z ʂ #\?Ҹ@ ``H3 `#\`  ``(`@ @ `M#\``(`@ @``=```(`@ @@`="```(`@ @ c6 ``+`@  ````(`@ @` #\e`T@  `#\ T``(`@ @@`="`` ````(`@ @@`="` `#\ "@0.`` `8.#@& +`  ` `L " #\`ƚ %`L``(`@ @@`=`, @ @#``  #+  @  @`$0@ \ ?@[\]^_` alphalowerupperalnumasciiblankcntrldigitgraphprintpunctspacewordxdigit``@`  @ 4.5 01-December-2003\ at end of patternPCRE does not support \L, \l, \N, \P, \p, \U, \u, or \X\c at end of patternunrecognized character follows \numbers out of order in {} quantifiernumber too big in {} quantifiermissing )conditional group contains more than two branchesinvalid condition (?(0)recursive call could loop indefinitelyreference to non-existent subpatternnumber after (?C is > 255two named groups have the same nameinternal error: unexpected repeatnothing to repeatrange out of order in character classinvalid escape sequence in character classunknown POSIX class namePOSIX collating elements are not supportedPOSIX named classes are supported only within a class\C not allowed in lookbehind assertionlookbehind assertion is not fixed lengththis version of PCRE is not compiled with PCRE_UTF8 supportregular expression too largeunmatched parenthesesinternal error: code overflowfailed to get memoryparentheses nested too deeplymissing ) after commentmalformed number after (?(assertion expected after (?((?R or (?digits must be followed by )unrecognized character after (?<closing ) for (?C expectedsyntax error after (?Punrecognized character after (?Punrecognized character after (?missing terminating ] for character classunknown option bit(s) seterroffset passed as NULL00<0H0T0`0l0x0000000000'1>> ` o oo $\ oo  !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~>~~x$   h    h&.%h +198 H Nx T Z0l bi*t v } 8 p X 0  @ X     8  h % ,` 38 : A H O V ]P dp k@ r y    F -h V, " .( M +D|  *< h8"P 5/  D J@^ fU( s.  Sh m" % 8 @ ` /L\ #8 l &H P<` 4<C4 W4 p| T  Xl    X,  , 30$ @EMU]dvL   @ x    h +8 .libs/libpcre.so.0.0.1maketables.c.LLC0get.cstudy.cset_start_bits.LLC0.LLC1.LLC2set_bitpcre.cfind_recurse.LLC14.LLC15.LLC16.LLC17.LLC18.LLC19.LLC20.LLC21.LLC22.LLC23.LLC24.LLC25.LLC26.LLC27.LLC28.LLC29.LLC30.LLC31.LLC32.LLC33.LLC34.LLC35.LLC36.LLC37.LLC38.LLC39.LLC40.LLC41.LLC42.LLC43.LLC44.LLC45.LLC46.LLC47.LLC48.LLC49.LLC50.LLC51.LLC52.LLC53.LLC54escapescould_be_emptyfind_firstassertedcharis_counted_repeatcheck_posix_syntaxOP_lengthscould_be_empty_branchfind_bracketposix_namesposix_name_lengthscompile_branch.LLC5pcre_default_tablesdigitabis_startlinecheck_posix_namecheck_escapeis_anchoredmatchfirst_significant_coderep_minrep_maxposix_class_mapsadjust_recurseread_repeat_countsmatch_reffind_fixedlengthcompile_regex_START__END_strncmpmemcmppcre_free_substringpcre_free_substring_listpcre_malloc_etextpcre_info.umulpcre_exectolowerpcre_copy_substring_PROCEDURE_LINKAGE_TABLE__edata_GLOBAL_OFFSET_TABLE_memcpymemsetmallocpcre_fullinfopcre_compilepcre_get_substringpcre_version.rem__ctypememmovetoupperstrcmppcre_stack_mallocpcre_studyfreepcre_freepcre_get_substring_listpcre_copy_named_substringpcre_configpcre_maketables_DYNAMIC_endpcre_calloutstrchrpcre_get_stringnumber.divpcre_stack_freepcre_get_named_substringd )d 6<EoY 5dtʀ!Afǂ܂6y݂&DE+؂+9UPEւ5Pqׂ  ۀ; K X i 3q J{ b x À< A 6G rO m Uw o ƀ ؀yÀ؀-h5F̀N1Zz$? D?DDD?$DD$DI,DN8DRTDN`DRdDNhDRlDYDRDYDZD\D^D_D^D_D^D_D^ D_DaDc Dd8Dc<DdDDcHDdLDcPDdTDfXDhdDi|DhDiDhDiDhDkDlDmDnDoDpTDqDZDyDsDyD|D|D} D~ D,D8D\DyxDy|DD@@@@@A@{x@{$dh=dh"dh(<7a{K'Vf3Xǂ!dȂ/E+Â+$U;~E ;\‚܀ ƀ; K X i q 5{ M c < A !G ]O q m ̀ @w Z ÀdÀπ-S5qFNˀZe$?h@>@>D?DEDG$DI0DKPDOlDRxDQ|DRDSDRDSDTDUDXDLDY@@ԀAB@BC @Q@R#@Sx,@Q7@RE@SN@QY@Rg@Sp$q${X@y @y@y@z@z@zD{D}D{ D}D0D@DXD`Dd@|d$l$#@/@?@O@b@ u@\DD DDD$D0D8@@ 8$@$ @@@@DDDDDD D D(D8D<D@DDDHDPD\DhDtDxD|DDDDDDDDDDDDDDD@@*@>@W@`@k@v@$$@DDDD$4$,@@@@@DDD D,DHDHDLDTDXD\DlDxD!|DDD D"%@2@C$D$Cd@Ap@A@A@B@B @BDCDD DCDEDF(DG0@D 0$8$Y@XDYDZDYDZ$4d01j d0$d0,<;eO+Z j7\͂ 'j΂5E+ɂ +*UAEǂ &AbȂ ̀; K X i $q ;{ S i < A 'G cO w m Ӏ Fw ` ɀjɀՀ-Y5wFN"рZk$=0@<@< @< @< D=D>D?D>D?(D@DDAd$l$Z@X@X @X@Y&@YDZDgDhDoDvDDhDDDpDuDvDxDDDDDDD0D4DHD`DdDxDDDDDDDDDDDD D D(D<D*<DDDTD\DdDclDtDD D D DDDDDD,DDDHD\DtD xDD$D%D$DDVD<DVDFDGDIDKPDLXDMxDL|DMDGD[D\DlDgD3D5(D6,D50D64D58D6<DXDDDqDy0@[ 9cL@gZ@hj@gx@h@g@h@K P$8$@@@DDDDDDD D$D(D(DHDTDXD`DlDDDDDDDDDDDDDDDDD DDDDD D$D0D8DD$@1@ F@SDh$Lid( 7d(#d(*<9c}M)X h5Zʂ$g˂2E+Ƃ +'U>EĂ#>_ł߀ ɀ; K X i !q 8{ P f < A $G `O t m Ѐ Cw ] ƀgƀҀ-V5tFN΀Zh΀B$-0D-D.D-D.$$$LT@K ;@K J@K DLDNDO DP$DQ@DRLDTdDU]$^$ls@j@j@j@k DlDpDlDpDlDp Dl$Dp(Dn,Dp0Dq8DsPDtlDlDyDDD}DDDDD D<DDDLDTDh@n h$$x@@DDDDD<D@D@DHDTD\DhDp $ $# @!7@!P@!`@"o@" D#D$D#D)D#D* D)$D#(D*,D18D2HDpD>xDKD{DzD{D~D|D] D_,Da,D`<Da@D_DDaDDbTDcDfDcDfDeDhDoDqDsDDDDDDD DD D,D0D4D\DdDpD~@$ @%@% @=dl@=x@\@$$"@DDD D D4DhDxDDDDD$$#@@%@2@DDD(D(D,D0DhDxD!D!D"D-D.D2,D50C@ N@ 0Y$8Z$L%y@K@K@KDLDODR@DUhDZpDbDcDM$$&@@DDDDDDD D$D0DTD`DlDpDDDDDDDDDDDDDDDDDDDDD,DXD\D`D`DhDpD|DDDDDDDD"@@@@@ $H$8*</@7<@7H@7D8D=D8D?D@ DA,DB8DDDDEPDF`DKpD=tDmV@?_@D8ph$i$*~@@DDDDD D,D8DDDLDTDl@l$t$+D@@@DDDDD,D0D<DTDXDdDxDDDDD?DDDDD DD%`D@d@ @ ,@<@  @dd4$|5$Y-K@WX@Wh@W~@XDYDZD_ D\(D]@D``$h$w.(@v@v @v DwDyDzD{D|PD`D~tDxD@x $$.@ @DDDD D$D<DLDdD@"$#$/L:@H@V@b@DDD DDDD<m@y@ @@LTT$\$/DHРLPT X \ 0` >dDDD DDD D$D4D8DDDHDLDPDXD\D`DdDhDlDpDtDxDD D'D(D*D,D-D6D= D?D@D=D@D> D?$D>(D@,DA0DM8DQ8DR@DPDDQHD HD PD )PD &TD )XD )hD RtD ^D eD ^D eD ^D eD aD bD `D bD cD bD cD nD rD nD rD pD rD o$D r(D DD PD TD XD \D `D dD D D D D D D D D D D D  D $D 0D 4D 8D <D LD PD XD dD tD D D D mD .D 1D 2 D d<D eDD fLD 8TD ?TD ;XD ?`D KpD ND OD OD PD UD VD UD VD WD XD \ D CD SD RD (D B0D A4D B8D A<D B@D DDD CHD DLD CPD DTD zTD \D pD D D D D D D D D D D D 8D 8D <D LD TD TD 6tD 7|D y|D iD mD lD mD lD nD rD qD rD qD sD _D `D xD }D D }D D D (D \D hD lD pD tD |D D D D D D D D D D D D D $D (D ,D 8D 8D <D HD TD \D `D hD hD lD pD tD xD |D D D D D D D D DD D D D D D D D D D D $D 4D @D DD HD LD \D `D dD hD lD |D D D D D D D D S D D D D  D  D  D  D  D  (D 0 D # D 0 D # D 0 D K D J D K D K D 2 D 4 D 5 D < D = D ? D = D ? D > D < D = D ? D > D A $D B (D  0D  8D  HD  lD  D  D  D D 2 D 3 D 8 D @ D F D H D I D N D V D ^ D N D P D N D Q D N D ^ D N D ^ D i D n D ,D <D DD LD PD TD XD hD lD xD D D D - D , D - D < D  D  D  D  D  D D D  D D  D D  D  D  $D  (D  ,D  <D HD TD XD \D `D  xD D * D + D + D * D , D  D  D D D D  D BD I0D N@D P\D RdD V|D WD VD WD XD XD YD SD QD OD D `D d$D n(D e,D f0D n4D |<D LD XD `D lD pD xD D D D D D D D D D D D D D D D D D D D D D D D  D ,D 8D @D DD PD `D dD hD lD tD D D D D D D D D D D D D D (D 8D @D pTD qXD r|D D D D D D D D D D D D pD rD qD rD sD tD s D uD t D v$D f0D g4D `@D b@D aDD bHD `LD bPDnXD CXD B\D 7hDXtD\D]D[DYDZD\D <D =D]DqDqDzDDDD DD D$D0D<D`DdDlDtD|DDDDDD DD D D D D D D D D '$D '(D #0D $4D #8D $<D #@D $DDTDXDdDpDxD|D|DDDD DDDDDDDDDDDDDDDDFDI8DR<DX@DkLDXDlDDDDDDDDD7DnDmD[D_DaDcDd D(D@DLDXD`D`DdDhDlDDD+D,$D-(D,,D-0D&8D'`D(dD'hD"pDD4D9DD6DD  D  D|D|DDDDDDDDDDDDDDDDDD DD$D(D0D<D<DLDpDDDDDDDDDDDDD}D|DtDDudD tD tD xD |D D D D D D !D "D $D "D #D *D ,D cD dD cD eD  D D D 8D HD LD pD xD |D D D D D D D D /D .D /D ;D =D >D LD OD ND O D ND OD P(D B@D lD xD D D D D D D D D D D D D D DG DI,DL8D ,@D -XD .pD -tD .xD .|D1D  I@ \@ g@ z@    @ Ȁ ݀ @!@!!(!<!N!\@!o@ !@!@!@!!@!À!ۀ!!@"""%"A@"X "m!|"~@" "#x"$"%""Ҁ"@# #!|#+@" #8#x#H$#Y%#l@ HT#w##@# #Ҁ!|#@" ##x$$$%$$@ L$/ +$9 +$E@ , 44$T$g$@$ $!|$@" $̀#x$݀$$%<% +% +%@ , <%&@ M  %5@   0%>@ \%M@ %[ +%e +%q@ , %@ t%@  %@  t%@  |%@ %@ %@ %@ %@ %@ %@ &@ & @   D&@  H L&#@  &.@  &9@  <&D@ c&M dp&]@ e&h@ f&x@ c& dp&@ e&@ f&@ c& dp&@ e&@ f$&@ &@ '@ '@ 8|'@ '2@ '@@ 'L@ 'Z@ p T'f@H0'o@('y@ `'t'@'@'@|'@ '@ '@ '$ '$P<(  D(@ ('@ (8 P(H T(W@ (h \(z `(d(h(l(pDDD DDDDD$D(D,D0D 8D@D LD!PDXDXD!\D%dD!hD%lDtD%xD|D!D%D)D+D,D+D,D1D3D5D4D5D:DD8DFHDGLDlPD\DpDxDDDDDDD%DDDDDDDDDDDDDDD D@DDDHDLDPDTDXD\D`DdDlDpDoDpDrDxDtDuDtDuDvDvDUDWDXD^Dc DeDcDeDd$D_DD>PDX(@ (@ (@)@)@)%@)0);)G@)[@)q@)@))) )@ )@)@)@nX*$`*$S*@*(@*8@*K@DDDDDD$D(DDD\DxDD DDDDD0D `*^@ *l@ *v@ $d*@ *@ *@ *@ `*$h*$'U*@%*@%*@&D'D)D*D)D.D1$D2(D3DD4\DGtDHDJD9D:D?DADFDK *@) + @* +@0 $`+$@) +2@* +<@) +J@*  +T$(+U$eV,+s@d+@d+@dDeDfDeDiDk$Dm(Do4Dr\DdDhDtDDDDDD~DxDzD +@f+@h+@i+@k +@h+@i+@k +@h+@i,@k   , $, $X,,*@,:@,I@,Z@,n@DDD DD D $D (D ,D0D4D 8D%@D7LD*PD7TD>`DFtDa|DHDIDJDGDQDRDaDHDIDJDaDjDnDpDDDD D D,D0D4D8D@DLDPDTDXD\D`DdDhDlDpDtDxD|DDDDDDDDDDDDDDDD,D8D<DXD|DD D DDEDDD D0D<D@D`DdDhDtDDDDDDDDDDDDqDwD}D0D4D8DLD\DdDhD6hD7lD?pDA|DtDuD~DDDDCDDDLDNDOD[D^$D^(D_<D`LDS\DDDDDDDDDDDDDD(DlDpDxD*D-DDDDDDDDDDDDDDDDDDDD(D0D0D4D@DHDxDDDD;D@DBDD$DC(DD,DEXDGhDMtDNxDRDQDRDQDSD=D>D>DDDD D 0D DD HD D D D D D D D D D D D( D* D+ D D! D! D" D |D D D D D D, D- D- D1 D/ D3 D D D D D D 4D 4D 8D 8D @D @D LD LD TD dD tD D D D& D D D D D D D D D D DV $D` $D^ (D` ,D^ 0D_ 4Dd 8De @Dh lDb xD D D D D D D D D D D D D D D D D| $Dx 0Dl <Dp HD TDt `D lD xD xD |D D D D D D D D D D D D DD DiDDLDXD`DdDDDDDDDD D(D!@D DD!HD`HD'PD]\D_D`D_D,D-D1D5D=DWD8D8DDDDDD0D4D8DDDDDDDDDDDuD@D'(D(0DF8,|@,@,@,@,,ƀ,Ԁ,@ ,@ -@ - @ -2 -F@-T-f@-s-@----ր-c.c.@d.(@e.>@f.Oc.Yc.c@d.y@e.@f..@ .@ .@ .р.@<l.c.c/@d/@e/.@f/?@0h/P@]$\/`@x/n@/|//@ H /c/c/@d/@e/@f //0@ |0@,80!$0"$^l03@\0A@\0N@\0\@\0o@]D^D_D^D_ DpD_DpD_ Dp$Dt0Dv<DwHD||DzD}0z@_0$0$lm0@i0@i0@j0@j0@j0@j0k\DlDDl DDlD D0D4D@DDDHDLDPDTD`DdDpDDD>DCDGDIDKDLDLDMDD0D4D@DDDLDPDTDXD`D|DDDQDXDD_DDDD,DHDXD\D`DdDhDpDDDDDDDDDDDDDDDDDDDDDD D DD(D,D0D4D8D@D|DDDDDD DKDLDNDODgDi Dj0Dl8DrDDsPDu`DwDDDDDDDDDDDD0D@DDDHDLDTDXD\D`DxDDDDDDDDDDDDD%D&D5D5D7D8D7D8D8D9D8 D:0D;<D?DD@dDApDCD=DJDJDLDJDJDODQDQ DSD^0D_dD`pDdxDeDfDgDbDnDnDpDnDnDsDuDu0Dw8DTD`DdDhDlDpDtDxDxDDDDDDDDDDDDDDDDDDDDD D D D D ,D <D HD PD pD |D D D! D! D# D! D! D& D( D) D* (DF @DG PDF dDJ tDL Db Dc Dd De D` D D D D D D D $D DD PD hD tD xD |D D D D D D D D D D D D D D D D D D D D D D D D D D D D D @D" LD# \D" pDP DU D D D D D D D D 0D 8D LD hD |D D DU DX DZ D\DZDZ D,D8DTD\DdxDe|DgDjDlDjDjDsDuDs DsD|$D~0D|TD|XDlDxDDDDDDDDD,D0D*DD-LD.`D-xD2D3D2D7D8D7D<D=,D<DDA\DBpDCtDBxDC|DADGDHDIDHDIDGDDDDDDDDDDD D$D,D0D4D`DhDpD|DDDDDDDDDDDDDDD$D0DHDLDXDxD-xD-|D/D0D1D-D-D4D6D6D8DDD$D(D,D0D8D<D@DDDDDPDXD(`D(lD0tD6DHDIDGDHDGDIDHDJDK DLDWD]Df,Dj4Dn<Do\DphDpDlDqD|D|DDDDD~D|D| D_4D]XD]\DOpDQDQDAD>D@DAD@DBD@D>D?DBDCD#D$D#D$D) D)D*D.,D80D.4D/8D3<D8@D9DD/HD4LD9LD:TDB\DDpDKtDDDEDKDMDODVDYDYD[D\DaD`DaDaDbDc(DR0DQ4DR8DR<DSHDTTD=\D?tD?|DDDDDDDDDDDDDDDDDDDDDDDD D DPDPDXD\DhDlDDDDDDDD-D- D00D68D?DD@dDApDBDFD8D9D:DDDDDD DD D  D $D 8D @D DDTDXD\DdDhDDDDDDDDDDD4D@DLD`DpDDDDDDpDqDsDuDwDxDyDzDD<D`DdDxDxDDDDDDDDD D,DLDXXDihDkDrDtDuDwDmDnDnDZ,D[<DZ@D[DD^tDaDDDDDD D (D ,D 4D <D `D D D! D# D' D! D# D' D# D" D! D" D# D$ D) D' D+ D- D. D/!D0!D5!$D6!0D7!8D9!<D7!@D!LD!L0@q1@r1 @s1@1$@11@1>@1I@1V@1i1~@ 1@1@1@1ƀ,1@1@1@1@2 @2@2&@ 20@2I@2]@2q@2`2X2@02Ā0$!L2$"2$2@2@3@3@3#@37@3F\3V`DD/D D'D/ D$D)(D,D4D8D <D#@D$DD&HD)LD/PD0XD1D8D7D:D7D6D:D<D=D?D@DADBDGDIDLDIDJ DIDJDIDJDI DL D\(DL,D]0DX8D\@DXDDTHDSLDTPDSTDLXDS\DT`DVdDWhDVlDWpDPtDLxDN|DODPDZDVDWD~DDwD~DDwDDDDDDDDDDDDDD DD D$D(D8D<D@DdDtDDDDDDDDDDDDDDDDDD DD8D \D tD xD D D D D D eD mD hD D "$D 0(D -4D .8D 0<D 3TD ^`D _dDxD @D FD HD ND RD UD WD ZD YD ZD YD Z D ^D J D <D DDhDDDDDDDD$D(D`DlDDDDDDDDDDDD n3i@3y@3@3@ 3@3@3@3؀33 4!4"|4/#x4I$t4a%4t&p4@'4)l4@*4@< 4@4@h4@4@4@  x5@  5@  5@5'@54@  (d5>@5K@x5X@  <h5b@$L5k@PX`5t$5u c5 d5 e5 f5 g6&_69&c86]&d@6&lF6&h6&P7&`7C&7h& 7dhas: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.2as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.2as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.2as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.2.hash.dynsym.dynstr.SUNW_version.rela.data.rel.ro.local.rela.data.rel.rela.got.rela.plt.text.rodata.got.plt.dynamic.data.rel.ro.local.data.rel.data.bss.symtab.strtab.stab.comment.shstrtab.stabstrmaketables.c/usr2/SOURCES/S9/pcre-4.5/maketables.cgcc2_compiled.int:t(0,1)=r(0,1);-2147483648;2147483647;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,3);-2147483648;2147483647;unsigned int:t(0,4)=r(0,4);000000000000000000000000;000000000000037777777777;long unsigned int:t(0,5)=r(0,5);000000000000000000000000;000000000000037777777777;long long int:t(0,6)=@s64;r(0,6);001000000000000000000000;000777777777777777777777;long long unsigned int:t(0,7)=@s64;r(0,7);000000000000000000000000;001777777777777777777777;short int:t(0,8)=@s16;r(0,8);-32768;32767;short unsigned int:t(0,9)=@s16;r(0,9);0;65535;signed char:t(0,10)=@s8;r(0,10);-128;127;unsigned char:t(0,11)=@s8;r(0,11);0;255;__int128_t:t(0,12)=@s128;r(0,12);000000000000000000000000;0377777777777777777777777777777777;__uint128_t:t(0,13)=@s128;r(0,13);000000000000000000000000;0377777777777777777777777777777777;float:t(0,14)=r(0,1);4;0;double:t(0,15)=r(0,1);8;0;long double:t(0,16)=r(0,1);16;0;complex int:t(0,17)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,18)=R3;8;0;complex double:t(0,19)=R4;16;0;complex long double:t(0,20)=R5;32;0;__builtin_va_list:t(0,21)=*(0,22)=(0,22)_Bool:t(0,23)=@s8;-16;maketables.cinternal.hconfig.h/usr/include/ctype.h/usr/include/iso/ctype_iso.h/usr/include/sys/feature_tests.h/usr/include/sys/isa_defs.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/limits.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/syslimits.h/usr/include/iso/limits_iso.h/usr/include/sys/int_limits.hclock_t:t(9,1)=(0,3)/usr/include/setjmp.h/usr/include/iso/setjmp_iso.hjmp_buf:t(13,1)=(13,2)=ar(13,3)=r(13,3);000000000000000000000000;000000000000037777777777;;0;11;(0,1)sigjmp_buf:t(12,1)=(12,2)=ar(13,3);0;18;(0,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdarg.h__gnuc_va_list:t(14,1)=(0,21)va_list:t(14,2)=(14,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stddef.hptrdiff_t:t(15,1)=(0,1)size_t:t(15,2)=(0,4)wchar_t:t(15,3)=(0,3)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio.h/usr/include/iso/stdio_iso.h/usr/include/sys/va_list.h__va_list:t(18,1)=(18,2)=*(0,22)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio_tag.h__FILE:t(19,1)=(19,2)=xs__FILE:/usr/include/stdio_impl.hssize_t:t(20,1)=(0,1)__FILE:T(19,2)=s16_cnt:(20,1),0,32;_ptr:(20,2)=*(0,11),32,32;_base:(20,2),64,32;_flag:(0,11),96,8;_file:(0,11),104,8;__orientation:(0,4),112,2;__ionolock:(0,4),114,1;__seekable:(0,4),115,1;__filler:(0,4),116,4;;__longlong_t:t(17,1)=(0,6)FILE:t(17,2)=(19,1)fpos_t:t(17,3)=(0,3)off_t:t(16,1)=(0,3)off64_t:t(16,2)=(17,1)fpos64_t:t(16,3)=(17,1)/usr/include/stdlib.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/iso/stdlib_iso.hdiv_t:t(22,1)=(22,2)=s8quot:(0,1),0,32;rem:(0,1),32,32;;ldiv_t:t(22,3)=(22,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;lldiv_t:t(21,1)=(21,2)=s16quot:(0,6),0,64;rem:(0,6),64,64;;uid_t:t(21,3)=(0,3)/usr/include/string.h/usr/include/iso/string_iso.hpcre.hpcre:t(25,1)=(25,2)=xsreal_pcre:pcre_extra:T(25,3)=s16flags:(0,5),0,32;study_data:(18,2),32,32;match_limit:(0,5),64,32;callout_data:(18,2),96,32;;pcre_extra:t(25,4)=(25,3)pcre_callout_block:T(25,5)=s40version:(0,1),0,32;callout_number:(0,1),32,32;offset_vector:(25,6)=*(0,1),64,32;subject:(25,7)=*(25,8)=k(0,2),96,32;subject_length:(0,1),128,32;start_match:(0,1),160,32;current_position:(0,1),192,32;capture_top:(0,1),224,32;capture_last:(0,1),256,32;callout_data:(18,2),288,32;;pcre_callout_block:t(25,9)=(25,5)BOOL:t(2,1)=(0,1) :T(2,2)=eESC_A:1,ESC_G:2,ESC_B:3,ESC_b:4,ESC_D:5,ESC_d:6,ESC_S:7,ESC_s:8,ESC_W:9,ESC_w:10,ESC_dum1:11,ESC_C:12,ESC_Z:13,ESC_z:14,ESC_E:15,ESC_Q:16,ESC_REF:17,; :T(2,3)=eOP_END:0,OP_SOD:1,OP_SOM:2,OP_NOT_WORD_BOUNDARY:3,OP_WORD_BOUNDARY:4,OP_NOT_DIGIT:5,OP_DIGIT:6,OP_NOT_WHITESPACE:7,OP_WHITESPACE:8,OP_NOT_WORDCHAR:9,OP_WORDCHAR:10,OP_ANY:11,OP_ANYBYTE:12,OP_EODN:13,OP_EOD:14,OP_OPT:15,OP_CIRC:16,OP_DOLL:17,OP_CHARS:18,OP_NOT:19,OP_STAR:20,OP_MINSTAR:21,OP_PLUS:22,OP_MINPLUS:23,OP_QUERY:24,OP_MINQUERY:25,OP_UPTO:26,OP_MINUPTO:27,OP_EXACT:28,OP_NOTSTAR:29,OP_NOTMINSTAR:30,OP_NOTPLUS:31,OP_NOTMINPLUS:32,OP_NOTQUERY:33,OP_NOTMINQUERY:34,OP_NOTUPTO:35,OP_NOTMINUPTO:36,OP_NOTEXACT:37,OP_TYPESTAR:38,OP_TYPEMINSTAR:39,OP_TYPEPLUS:40,OP_TYPEMINPLUS:41,OP_TYPEQUERY:42,OP_TYPEMINQUERY:43,OP_TYPEUPTO:44,OP_TYPEMINUPTO:45,OP_TYPEEXACT:46,OP_CRSTAR:47,OP_CRMINSTAR:48,OP_CRPLUS:49,OP_CRMINPLUS:50,OP_CRQUERY:51,OP_CRMINQUERY:52,OP_CRRANGE:53,OP_CRMINRANGE:54,OP_CLASS:55,OP_NCLASS:56,OP_XCLASS:57,OP_REF:58,OP_RECURSE:59,OP_CALLOUT:60,OP_ALT:61,OP_KET:62,OP_KETRMAX:63,OP_KETRMIN:64,OP_ASSERT:65,OP_ASSERT_NOT:66,OP_ASSERTBACK:67,OP_ASSERTBACK_NOT:68,OP_REVERSE:69,OP_ONCE:70,OP_COND:71,OP_CREF:72,OP_BRAZERO:73,OP_BRAMINZERO:74,\OP_BRANUMBER:75,OP_BRA:76,;uschar:t(2,4)=(0,11)real_pcre:T(25,2)=s28magic_number:(0,5),0,32;size:(15,2),32,32;tables:(2,5)=*(2,6)=k(0,11),64,32;options:(0,5),96,32;top_bracket:(0,9),128,16;top_backref:(0,9),144,16;first_byte:(0,9),160,16;req_byte:(0,9),176,16;name_entry_size:(0,9),192,16;name_count:(0,9),208,16;;real_pcre:t(2,7)=(25,2)pcre_study_data:T(2,8)=s40size:(15,2),0,32;options:(2,4),32,8;start_bits:(2,9)=ar(13,3);0;31;(2,4),40,256;;pcre_study_data:t(2,10)=(2,8)compile_data:T(2,11)=s44lcc:(2,12)=*(2,13)=k(2,4),0,32;fcc:(2,12),32,32;cbits:(2,12),64,32;ctypes:(2,12),96,32;start_code:(2,12),128,32;name_table:(2,14)=*(2,4),160,32;names_found:(0,1),192,32;name_entry_size:(0,1),224,32;top_backref:(0,1),256,32;backref_map:(0,4),288,32;req_varyopt:(0,1),320,32;;compile_data:t(2,15)=(2,11)branch_chain:T(2,16)=s8outer:(2,17)=*(2,16),0,32;current:(2,14),32,32;;branch_chain:t(2,18)=(2,16)recursion_info:T(2,19)=s24prevrec:(2,20)=*(2,19),0,32;group_num:(0,1),32,32;after_call:(2,12),64,32;save_start:(2,12),96,32;offset_save:(25,6),128,32;saved_max:(0,1),160,32;;recursion_info:t(2,21)=(2,19)match_data:T(2,22)=s96match_call_count:(0,5),0,32;match_limit:(0,5),32,32;offset_vector:(25,6),64,32;offset_end:(0,1),96,32;offset_max:(0,1),128,32;lcc:(2,12),160,32;ctypes:(2,12),192,32;offset_overflow:(2,1),224,32;notbol:(2,1),256,32;noteol:(2,1),288,32;utf8:(2,1),320,32;endonly:(2,1),352,32;notempty:(2,1),384,32;start_code:(2,12),416,32;start_subject:(2,12),448,32;end_subject:(2,12),480,32;start_match:(2,12),512,32;end_match_ptr:(2,12),544,32;end_offset_top:(0,1),576,32;capture_last:(0,1),608,32;start_offset:(0,1),640,32;recursive:(2,23)=*(2,21),672,32;callout_data:(18,2),704,32;thisframe:(2,24)=*(2,25)=xsheapframe:,736,32;;match_data:t(2,26)=(2,22)pcre_maketables:F(2,5)yield:r(20,2)p:r(20,2)i:r(0,1)x:r(0,1)x:r(0,1)get.c/usr2/SOURCES/S9/pcre-4.5/get.cgcc2_compiled.int:t(0,1)=r(0,1);-2147483648;2147483647;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,3);-2147483648;2147483647;unsigned int:t(0,4)=r(0,4);000000000000000000000000;000000000000037777777777;long unsigned int:t(0,5)=r(0,5);000000000000000000000000;000000000000037777777777;long long int:t(0,6)=@s64;r(0,6);001000000000000000000000;000777777777777777777777;long long unsigned int:t(0,7)=@s64;r(0,7);000000000000000000000000;001777777777777777777777;short int:t(0,8)=@s16;r(0,8);-32768;32767;short unsigned int:t(0,9)=@s16;r(0,9);0;65535;signed char:t(0,10)=@s8;r(0,10);-128;127;unsigned char:t(0,11)=@s8;r(0,11);0;255;__int128_t:t(0,12)=@s128;r(0,12);000000000000000000000000;0377777777777777777777777777777777;__uint128_t:t(0,13)=@s128;r(0,13);000000000000000000000000;0377777777777777777777777777777777;float:t(0,14)=r(0,1);4;0;double:t(0,15)=r(0,1);8;0;long double:t(0,16)=r(0,1);16;0;complex int:t(0,17)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,18)=R3;8;0;complex double:t(0,19)=R4;16;0;complex long double:t(0,20)=R5;32;0;__builtin_va_list:t(0,21)=*(0,22)=(0,22)_Bool:t(0,23)=@s8;-16;get.cinternal.hconfig.h/usr/include/ctype.h/usr/include/iso/ctype_iso.h/usr/include/sys/feature_tests.h/usr/include/sys/isa_defs.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/limits.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/syslimits.h/usr/include/iso/limits_iso.h/usr/include/sys/int_limits.hclock_t:t(9,1)=(0,3)/usr/include/setjmp.h/usr/include/iso/setjmp_iso.hjmp_buf:t(13,1)=(13,2)=ar(13,3)=r(13,3);000000000000000000000000;000000000000037777777777;;0;11;(0,1)sigjmp_buf:t(12,1)=(12,2)=ar(13,3);0;18;(0,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdarg.h__gnuc_va_list:t(14,1)=(0,21)va_list:t(14,2)=(14,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stddef.hptrdiff_t:t(15,1)=(0,1)size_t:t(15,2)=(0,4)wchar_t:t(15,3)=(0,3)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio.h/usr/include/iso/stdio_iso.h/usr/include/sys/va_list.h__va_list:t(18,1)=(18,2)=*(0,22)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio_tag.h__FILE:t(19,1)=(19,2)=xs__FILE:/usr/include/stdio_impl.hssize_t:t(20,1)=(0,1)__FILE:T(19,2)=s16_cnt:(20,1),0,32;_ptr:(20,2)=*(0,11),32,32;_base:(20,2),64,32;_flag:(0,11),96,8;_file:(0,11),104,8;__orientation:(0,4),112,2;__ionolock:(0,4),114,1;__seekable:(0,4),115,1;__filler:(0,4),116,4;;__longlong_t:t(17,1)=(0,6)FILE:t(17,2)=(19,1)fpos_t:t(17,3)=(0,3)off_t:t(16,1)=(0,3)off64_t:t(16,2)=(17,1)fpos64_t:t(16,3)=(17,1)/usr/include/stdlib.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/iso/stdlib_iso.hdiv_t:t(22,1)=(22,2)=s8quot:(0,1),0,32;rem:(0,1),32,32;;ldiv_t:t(22,3)=(22,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;lldiv_t:t(21,1)=(21,2)=s16quot:(0,6),0,64;rem:(0,6),64,64;;uid_t:t(21,3)=(0,3)/usr/include/string.h/usr/include/iso/string_iso.hpcre.hpcre:t(25,1)=(25,2)=xsreal_pcre:pcre_extra:T(25,3)=s16flags:(0,5),0,32;study_data:(18,2),32,32;match_limit:(0,5),64,32;callout_data:(18,2),96,32;;pcre_extra:t(25,4)=(25,3)pcre_callout_block:T(25,5)=s40version:(0,1),0,32;callout_number:(0,1),32,32;offset_vector:(25,6)=*(0,1),64,32;subject:(25,7)=*(25,8)=k(0,2),96,32;subject_length:(0,1),128,32;start_match:(0,1),160,32;current_position:(0,1),192,32;capture_top:(0,1),224,32;capture_last:(0,1),256,32;callout_data:(18,2),288,32;;pcre_callout_block:t(25,9)=(25,5)BOOL:t(2,1)=(0,1) :T(2,2)=eESC_A:1,ESC_G:2,ESC_B:3,ESC_b:4,ESC_D:5,ESC_d:6,ESC_S:7,ESC_s:8,ESC_W:9,ESC_w:10,ESC_dum1:11,ESC_C:12,ESC_Z:13,ESC_z:14,ESC_E:15,ESC_Q:16,ESC_REF:17,; :T(2,3)=eOP_END:0,OP_SOD:1,OP_SOM:2,OP_NOT_WORD_BOUNDARY:3,OP_WORD_BOUNDARY:4,OP_NOT_DIGIT:5,OP_DIGIT:6,OP_NOT_WHITESPACE:7,OP_WHITESPACE:8,OP_NOT_WORDCHAR:9,OP_WORDCHAR:10,OP_ANY:11,OP_ANYBYTE:12,OP_EODN:13,OP_EOD:14,OP_OPT:15,OP_CIRC:16,OP_DOLL:17,OP_CHARS:18,OP_NOT:19,OP_STAR:20,OP_MINSTAR:21,OP_PLUS:22,OP_MINPLUS:23,OP_QUERY:24,OP_MINQUERY:25,OP_UPTO:26,OP_MINUPTO:27,OP_EXACT:28,OP_NOTSTAR:29,OP_NOTMINSTAR:30,OP_NOTPLUS:31,OP_NOTMINPLUS:32,OP_NOTQUERY:33,OP_NOTMINQUERY:34,OP_NOTUPTO:35,OP_NOTMINUPTO:36,OP_NOTEXACT:37,OP_TYPESTAR:38,OP_TYPEMINSTAR:39,OP_TYPEPLUS:40,OP_TYPEMINPLUS:41,OP_TYPEQUERY:42,OP_TYPEMINQUERY:43,OP_TYPEUPTO:44,OP_TYPEMINUPTO:45,OP_TYPEEXACT:46,OP_CRSTAR:47,OP_CRMINSTAR:48,OP_CRPLUS:49,OP_CRMINPLUS:50,OP_CRQUERY:51,OP_CRMINQUERY:52,OP_CRRANGE:53,OP_CRMINRANGE:54,OP_CLASS:55,OP_NCLASS:56,OP_XCLASS:57,OP_REF:58,OP_RECURSE:59,OP_CALLOUT:60,OP_ALT:61,OP_KET:62,OP_KETRMAX:63,OP_KETRMIN:64,OP_ASSERT:65,OP_ASSERT_NOT:66,OP_ASSERTBACK:67,OP_ASSERTBACK_NOT:68,OP_REVERSE:69,OP_ONCE:70,OP_COND:71,OP_CREF:72,OP_BRAZERO:73,OP_BRAMINZERO:74,\OP_BRANUMBER:75,OP_BRA:76,;uschar:t(2,4)=(0,11)real_pcre:T(25,2)=s28magic_number:(0,5),0,32;size:(15,2),32,32;tables:(2,5)=*(2,6)=k(0,11),64,32;options:(0,5),96,32;top_bracket:(0,9),128,16;top_backref:(0,9),144,16;first_byte:(0,9),160,16;req_byte:(0,9),176,16;name_entry_size:(0,9),192,16;name_count:(0,9),208,16;;real_pcre:t(2,7)=(25,2)pcre_study_data:T(2,8)=s40size:(15,2),0,32;options:(2,4),32,8;start_bits:(2,9)=ar(13,3);0;31;(2,4),40,256;;pcre_study_data:t(2,10)=(2,8)compile_data:T(2,11)=s44lcc:(2,12)=*(2,13)=k(2,4),0,32;fcc:(2,12),32,32;cbits:(2,12),64,32;ctypes:(2,12),96,32;start_code:(2,12),128,32;name_table:(2,14)=*(2,4),160,32;names_found:(0,1),192,32;name_entry_size:(0,1),224,32;top_backref:(0,1),256,32;backref_map:(0,4),288,32;req_varyopt:(0,1),320,32;;compile_data:t(2,15)=(2,11)branch_chain:T(2,16)=s8outer:(2,17)=*(2,16),0,32;current:(2,14),32,32;;branch_chain:t(2,18)=(2,16)recursion_info:T(2,19)=s24prevrec:(2,20)=*(2,19),0,32;group_num:(0,1),32,32;after_call:(2,12),64,32;save_start:(2,12),96,32;offset_save:(25,6),128,32;saved_max:(0,1),160,32;;recursion_info:t(2,21)=(2,19)match_data:T(2,22)=s96match_call_count:(0,5),0,32;match_limit:(0,5),32,32;offset_vector:(25,6),64,32;offset_end:(0,1),96,32;offset_max:(0,1),128,32;lcc:(2,12),160,32;ctypes:(2,12),192,32;offset_overflow:(2,1),224,32;notbol:(2,1),256,32;noteol:(2,1),288,32;utf8:(2,1),320,32;endonly:(2,1),352,32;notempty:(2,1),384,32;start_code:(2,12),416,32;start_subject:(2,12),448,32;end_subject:(2,12),480,32;start_match:(2,12),512,32;end_match_ptr:(2,12),544,32;end_offset_top:(0,1),576,32;capture_last:(0,1),608,32;start_offset:(0,1),640,32;recursive:(2,23)=*(2,21),672,32;callout_data:(18,2),704,32;thisframe:(2,24)=*(2,25)=xsheapframe:,736,32;;match_data:t(2,26)=(2,22)pcre_get_stringnumber:F(0,1)code:P(1,1)=*(1,2)=k(25,1)stringname:P(25,7)rc:r(0,1)entrysize:(0,1)top:(0,1)bot:r(0,1)nametable:(2,14)mid:r(0,1)entry:r(2,14)c:r(0,1)mid:r(0,1)entry:r(2,14)c:r(0,1)mid:r(0,1)entry:r(2,14)c:r(0,1)pcre_copy_substring:F(0,1)subject:P(25,7)ovector:P(25,6)stringcount:P(0,1)stringnumber:P(0,1)buffer:P(1,3)=*(0,2)size:P(0,1)yield:r(0,1)pcre_copy_named_substring:F(0,1)code:P(1,1)subject:P(25,7)ovector:P(25,6)stringcount:P(0,1)stringname:P(25,7)buffer:P(1,3)size:p(0,1)size:r(0,1)n:r(0,1)pcre_get_substring_list:F(0,1)subject:P(25,7)ovector:P(25,6)stringcount:P(0,1)listptr:P(1,4)=*(1,5)=*(25,7)i:r(0,1)size:r(0,1)double_count:r(0,1)stringlist:r(1,6)=*(1,3)p:r(1,3)len:r(0,1)len:r(0,1)len:r(0,1)pcre_free_substring_list:F(0,22)pointer:P(1,5)pcre_get_substring:F(0,1)subject:P(25,7)ovector:P(25,6)stringcount:P(0,1)stringnumber:P(0,1)stringptr:P(1,5)yield:r(0,1)substring:r(1,3)pcre_get_named_substring:F(0,1)code:P(1,1)subject:P(25,7)ovector:P(25,6)stringcount:P(0,1)stringname:P(25,7)stringptr:P(1,5)n:r(0,1)pcre_free_substring:F(0,22)pointer:P(25,7)study.c/usr2/SOURCES/S9/pcre-4.5/study.cgcc2_compiled.int:t(0,1)=r(0,1);-2147483648;2147483647;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,3);-2147483648;2147483647;unsigned int:t(0,4)=r(0,4);000000000000000000000000;000000000000037777777777;long unsigned int:t(0,5)=r(0,5);000000000000000000000000;000000000000037777777777;long long int:t(0,6)=@s64;r(0,6);001000000000000000000000;000777777777777777777777;long long unsigned int:t(0,7)=@s64;r(0,7);000000000000000000000000;001777777777777777777777;short int:t(0,8)=@s16;r(0,8);-32768;32767;short unsigned int:t(0,9)=@s16;r(0,9);0;65535;signed char:t(0,10)=@s8;r(0,10);-128;127;unsigned char:t(0,11)=@s8;r(0,11);0;255;__int128_t:t(0,12)=@s128;r(0,12);000000000000000000000000;0377777777777777777777777777777777;__uint128_t:t(0,13)=@s128;r(0,13);000000000000000000000000;0377777777777777777777777777777777;float:t(0,14)=r(0,1);4;0;double:t(0,15)=r(0,1);8;0;long double:t(0,16)=r(0,1);16;0;complex int:t(0,17)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,18)=R3;8;0;complex double:t(0,19)=R4;16;0;complex long double:t(0,20)=R5;32;0;__builtin_va_list:t(0,21)=*(0,22)=(0,22)_Bool:t(0,23)=@s8;-16;study.cinternal.hconfig.h/usr/include/ctype.h/usr/include/iso/ctype_iso.h/usr/include/sys/feature_tests.h/usr/include/sys/isa_defs.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/limits.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/syslimits.h/usr/include/iso/limits_iso.h/usr/include/sys/int_limits.hclock_t:t(9,1)=(0,3)/usr/include/setjmp.h/usr/include/iso/setjmp_iso.hjmp_buf:t(13,1)=(13,2)=ar(13,3)=r(13,3);000000000000000000000000;000000000000037777777777;;0;11;(0,1)sigjmp_buf:t(12,1)=(12,2)=ar(13,3);0;18;(0,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdarg.h__gnuc_va_list:t(14,1)=(0,21)va_list:t(14,2)=(14,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stddef.hptrdiff_t:t(15,1)=(0,1)size_t:t(15,2)=(0,4)wchar_t:t(15,3)=(0,3)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio.h/usr/include/iso/stdio_iso.h/usr/include/sys/va_list.h__va_list:t(18,1)=(18,2)=*(0,22)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio_tag.h__FILE:t(19,1)=(19,2)=xs__FILE:/usr/include/stdio_impl.hssize_t:t(20,1)=(0,1)__FILE:T(19,2)=s16_cnt:(20,1),0,32;_ptr:(20,2)=*(0,11),32,32;_base:(20,2),64,32;_flag:(0,11),96,8;_file:(0,11),104,8;__orientation:(0,4),112,2;__ionolock:(0,4),114,1;__seekable:(0,4),115,1;__filler:(0,4),116,4;;__longlong_t:t(17,1)=(0,6)FILE:t(17,2)=(19,1)fpos_t:t(17,3)=(0,3)off_t:t(16,1)=(0,3)off64_t:t(16,2)=(17,1)fpos64_t:t(16,3)=(17,1)/usr/include/stdlib.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/iso/stdlib_iso.hdiv_t:t(22,1)=(22,2)=s8quot:(0,1),0,32;rem:(0,1),32,32;;ldiv_t:t(22,3)=(22,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;lldiv_t:t(21,1)=(21,2)=s16quot:(0,6),0,64;rem:(0,6),64,64;;uid_t:t(21,3)=(0,3)/usr/include/string.h/usr/include/iso/string_iso.hpcre.hpcre:t(25,1)=(25,2)=xsreal_pcre:pcre_extra:T(25,3)=s16flags:(0,5),0,32;study_data:(18,2),32,32;match_limit:(0,5),64,32;callout_data:(18,2),96,32;;pcre_extra:t(25,4)=(25,3)pcre_callout_block:T(25,5)=s40version:(0,1),0,32;callout_number:(0,1),32,32;offset_vector:(25,6)=*(0,1),64,32;subject:(25,7)=*(25,8)=k(0,2),96,32;subject_length:(0,1),128,32;start_match:(0,1),160,32;current_position:(0,1),192,32;capture_top:(0,1),224,32;capture_last:(0,1),256,32;callout_data:(18,2),288,32;;pcre_callout_block:t(25,9)=(25,5)BOOL:t(2,1)=(0,1) :T(2,2)=eESC_A:1,ESC_G:2,ESC_B:3,ESC_b:4,ESC_D:5,ESC_d:6,ESC_S:7,ESC_s:8,ESC_W:9,ESC_w:10,ESC_dum1:11,ESC_C:12,ESC_Z:13,ESC_z:14,ESC_E:15,ESC_Q:16,ESC_REF:17,; :T(2,3)=eOP_END:0,OP_SOD:1,OP_SOM:2,OP_NOT_WORD_BOUNDARY:3,OP_WORD_BOUNDARY:4,OP_NOT_DIGIT:5,OP_DIGIT:6,OP_NOT_WHITESPACE:7,OP_WHITESPACE:8,OP_NOT_WORDCHAR:9,OP_WORDCHAR:10,OP_ANY:11,OP_ANYBYTE:12,OP_EODN:13,OP_EOD:14,OP_OPT:15,OP_CIRC:16,OP_DOLL:17,OP_CHARS:18,OP_NOT:19,OP_STAR:20,OP_MINSTAR:21,OP_PLUS:22,OP_MINPLUS:23,OP_QUERY:24,OP_MINQUERY:25,OP_UPTO:26,OP_MINUPTO:27,OP_EXACT:28,OP_NOTSTAR:29,OP_NOTMINSTAR:30,OP_NOTPLUS:31,OP_NOTMINPLUS:32,OP_NOTQUERY:33,OP_NOTMINQUERY:34,OP_NOTUPTO:35,OP_NOTMINUPTO:36,OP_NOTEXACT:37,OP_TYPESTAR:38,OP_TYPEMINSTAR:39,OP_TYPEPLUS:40,OP_TYPEMINPLUS:41,OP_TYPEQUERY:42,OP_TYPEMINQUERY:43,OP_TYPEUPTO:44,OP_TYPEMINUPTO:45,OP_TYPEEXACT:46,OP_CRSTAR:47,OP_CRMINSTAR:48,OP_CRPLUS:49,OP_CRMINPLUS:50,OP_CRQUERY:51,OP_CRMINQUERY:52,OP_CRRANGE:53,OP_CRMINRANGE:54,OP_CLASS:55,OP_NCLASS:56,OP_XCLASS:57,OP_REF:58,OP_RECURSE:59,OP_CALLOUT:60,OP_ALT:61,OP_KET:62,OP_KETRMAX:63,OP_KETRMIN:64,OP_ASSERT:65,OP_ASSERT_NOT:66,OP_ASSERTBACK:67,OP_ASSERTBACK_NOT:68,OP_REVERSE:69,OP_ONCE:70,OP_COND:71,OP_CREF:72,OP_BRAZERO:73,OP_BRAMINZERO:74,\OP_BRANUMBER:75,OP_BRA:76,;uschar:t(2,4)=(0,11)real_pcre:T(25,2)=s28magic_number:(0,5),0,32;size:(15,2),32,32;tables:(2,5)=*(2,6)=k(0,11),64,32;options:(0,5),96,32;top_bracket:(0,9),128,16;top_backref:(0,9),144,16;first_byte:(0,9),160,16;req_byte:(0,9),176,16;name_entry_size:(0,9),192,16;name_count:(0,9),208,16;;real_pcre:t(2,7)=(25,2)pcre_study_data:T(2,8)=s40size:(15,2),0,32;options:(2,4),32,8;start_bits:(2,9)=ar(13,3);0;31;(2,4),40,256;;pcre_study_data:t(2,10)=(2,8)compile_data:T(2,11)=s44lcc:(2,12)=*(2,13)=k(2,4),0,32;fcc:(2,12),32,32;cbits:(2,12),64,32;ctypes:(2,12),96,32;start_code:(2,12),128,32;name_table:(2,14)=*(2,4),160,32;names_found:(0,1),192,32;name_entry_size:(0,1),224,32;top_backref:(0,1),256,32;backref_map:(0,4),288,32;req_varyopt:(0,1),320,32;;compile_data:t(2,15)=(2,11)branch_chain:T(2,16)=s8outer:(2,17)=*(2,16),0,32;current:(2,14),32,32;;branch_chain:t(2,18)=(2,16)recursion_info:T(2,19)=s24prevrec:(2,20)=*(2,19),0,32;group_num:(0,1),32,32;after_call:(2,12),64,32;save_start:(2,12),96,32;offset_save:(25,6),128,32;saved_max:(0,1),160,32;;recursion_info:t(2,21)=(2,19)match_data:T(2,22)=s96match_call_count:(0,5),0,32;match_limit:(0,5),32,32;offset_vector:(25,6),64,32;offset_end:(0,1),96,32;offset_max:(0,1),128,32;lcc:(2,12),160,32;ctypes:(2,12),192,32;offset_overflow:(2,1),224,32;notbol:(2,1),256,32;noteol:(2,1),288,32;utf8:(2,1),320,32;endonly:(2,1),352,32;notempty:(2,1),384,32;start_code:(2,12),416,32;start_subject:(2,12),448,32;end_subject:(2,12),480,32;start_match:(2,12),512,32;end_match_ptr:(2,12),544,32;end_offset_top:(0,1),576,32;capture_last:(0,1),608,32;start_offset:(0,1),640,32;recursive:(2,23)=*(2,21),672,32;callout_data:(18,2),704,32;thisframe:(2,24)=*(2,25)=xsheapframe:,736,32;;match_data:t(2,26)=(2,22)set_bit:f(0,22)start_bits:P(2,14)c:P(0,1)caseless:P(2,1)cd:P(1,1)=*(2,15)set_start_bits:f(2,1)code:P(2,12)start_bits:P(2,14)caseless:P(2,1)utf8:P(2,1)cd:P(1,1)c:r(0,1)dummy:(1,2)=B(0,1)tcode:r(2,12)try_next:r(2,1)tcode:r(2,12)try_next:r(2,1)tcode:r(2,12)try_next:r(2,1)d:r(0,1)pcre_study:F(1,3)=*(25,4)external_re:P(1,4)=*(1,5)=k(25,1)options:P(0,1)errorptr:P(1,6)=*(25,7)start_bits:(2,9)extra:r(1,3)study:r(1,7)=*(2,10)code:r(2,14)compile_block:(2,15)pcre.c/usr2/SOURCES/S9/pcre-4.5/pcre.cgcc2_compiled.int:t(0,1)=r(0,1);-2147483648;2147483647;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,3);-2147483648;2147483647;unsigned int:t(0,4)=r(0,4);000000000000000000000000;000000000000037777777777;long unsigned int:t(0,5)=r(0,5);000000000000000000000000;000000000000037777777777;long long int:t(0,6)=@s64;r(0,6);001000000000000000000000;000777777777777777777777;long long unsigned int:t(0,7)=@s64;r(0,7);000000000000000000000000;001777777777777777777777;short int:t(0,8)=@s16;r(0,8);-32768;32767;short unsigned int:t(0,9)=@s16;r(0,9);0;65535;signed char:t(0,10)=@s8;r(0,10);-128;127;unsigned char:t(0,11)=@s8;r(0,11);0;255;__int128_t:t(0,12)=@s128;r(0,12);000000000000000000000000;0377777777777777777777777777777777;__uint128_t:t(0,13)=@s128;r(0,13);000000000000000000000000;0377777777777777777777777777777777;float:t(0,14)=r(0,1);4;0;double:t(0,15)=r(0,1);8;0;long double:t(0,16)=r(0,1);16;0;complex int:t(0,17)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,18)=R3;8;0;complex double:t(0,19)=R4;16;0;complex long double:t(0,20)=R5;32;0;__builtin_va_list:t(0,21)=*(0,22)=(0,22)_Bool:t(0,23)=@s8;-16;pcre.cinternal.hconfig.h/usr/include/ctype.h/usr/include/iso/ctype_iso.h/usr/include/sys/feature_tests.h/usr/include/sys/isa_defs.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/limits.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/syslimits.h/usr/include/iso/limits_iso.h/usr/include/sys/int_limits.hclock_t:t(9,1)=(0,3)/usr/include/setjmp.h/usr/include/iso/setjmp_iso.hjmp_buf:t(13,1)=(13,2)=ar(13,3)=r(13,3);000000000000000000000000;000000000000037777777777;;0;11;(0,1)sigjmp_buf:t(12,1)=(12,2)=ar(13,3);0;18;(0,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdarg.h__gnuc_va_list:t(14,1)=(0,21)va_list:t(14,2)=(14,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stddef.hptrdiff_t:t(15,1)=(0,1)size_t:t(15,2)=(0,4)wchar_t:t(15,3)=(0,3)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio.h/usr/include/iso/stdio_iso.h/usr/include/sys/va_list.h__va_list:t(18,1)=(18,2)=*(0,22)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio_tag.h__FILE:t(19,1)=(19,2)=xs__FILE:/usr/include/stdio_impl.hssize_t:t(20,1)=(0,1)__FILE:T(19,2)=s16_cnt:(20,1),0,32;_ptr:(20,2)=*(0,11),32,32;_base:(20,2),64,32;_flag:(0,11),96,8;_file:(0,11),104,8;__orientation:(0,4),112,2;__ionolock:(0,4),114,1;__seekable:(0,4),115,1;__filler:(0,4),116,4;;__longlong_t:t(17,1)=(0,6)FILE:t(17,2)=(19,1)fpos_t:t(17,3)=(0,3)off_t:t(16,1)=(0,3)off64_t:t(16,2)=(17,1)fpos64_t:t(16,3)=(17,1)/usr/include/stdlib.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/iso/stdlib_iso.hdiv_t:t(22,1)=(22,2)=s8quot:(0,1),0,32;rem:(0,1),32,32;;ldiv_t:t(22,3)=(22,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;lldiv_t:t(21,1)=(21,2)=s16quot:(0,6),0,64;rem:(0,6),64,64;;uid_t:t(21,3)=(0,3)/usr/include/string.h/usr/include/iso/string_iso.hpcre.hpcre:t(25,1)=(25,2)=xsreal_pcre:pcre_extra:T(25,3)=s16flags:(0,5),0,32;study_data:(18,2),32,32;match_limit:(0,5),64,32;callout_data:(18,2),96,32;;pcre_extra:t(25,4)=(25,3)pcre_callout_block:T(25,5)=s40version:(0,1),0,32;callout_number:(0,1),32,32;offset_vector:(25,6)=*(0,1),64,32;subject:(25,7)=*(25,8)=k(0,2),96,32;subject_length:(0,1),128,32;start_match:(0,1),160,32;current_position:(0,1),192,32;capture_top:(0,1),224,32;capture_last:(0,1),256,32;callout_data:(18,2),288,32;;pcre_callout_block:t(25,9)=(25,5)BOOL:t(2,1)=(0,1) :T(2,2)=eESC_A:1,ESC_G:2,ESC_B:3,ESC_b:4,ESC_D:5,ESC_d:6,ESC_S:7,ESC_s:8,ESC_W:9,ESC_w:10,ESC_dum1:11,ESC_C:12,ESC_Z:13,ESC_z:14,ESC_E:15,ESC_Q:16,ESC_REF:17,; :T(2,3)=eOP_END:0,OP_SOD:1,OP_SOM:2,OP_NOT_WORD_BOUNDARY:3,OP_WORD_BOUNDARY:4,OP_NOT_DIGIT:5,OP_DIGIT:6,OP_NOT_WHITESPACE:7,OP_WHITESPACE:8,OP_NOT_WORDCHAR:9,OP_WORDCHAR:10,OP_ANY:11,OP_ANYBYTE:12,OP_EODN:13,OP_EOD:14,OP_OPT:15,OP_CIRC:16,OP_DOLL:17,OP_CHARS:18,OP_NOT:19,OP_STAR:20,OP_MINSTAR:21,OP_PLUS:22,OP_MINPLUS:23,OP_QUERY:24,OP_MINQUERY:25,OP_UPTO:26,OP_MINUPTO:27,OP_EXACT:28,OP_NOTSTAR:29,OP_NOTMINSTAR:30,OP_NOTPLUS:31,OP_NOTMINPLUS:32,OP_NOTQUERY:33,OP_NOTMINQUERY:34,OP_NOTUPTO:35,OP_NOTMINUPTO:36,OP_NOTEXACT:37,OP_TYPESTAR:38,OP_TYPEMINSTAR:39,OP_TYPEPLUS:40,OP_TYPEMINPLUS:41,OP_TYPEQUERY:42,OP_TYPEMINQUERY:43,OP_TYPEUPTO:44,OP_TYPEMINUPTO:45,OP_TYPEEXACT:46,OP_CRSTAR:47,OP_CRMINSTAR:48,OP_CRPLUS:49,OP_CRMINPLUS:50,OP_CRQUERY:51,OP_CRMINQUERY:52,OP_CRRANGE:53,OP_CRMINRANGE:54,OP_CLASS:55,OP_NCLASS:56,OP_XCLASS:57,OP_REF:58,OP_RECURSE:59,OP_CALLOUT:60,OP_ALT:61,OP_KET:62,OP_KETRMAX:63,OP_KETRMIN:64,OP_ASSERT:65,OP_ASSERT_NOT:66,OP_ASSERTBACK:67,OP_ASSERTBACK_NOT:68,OP_REVERSE:69,OP_ONCE:70,OP_COND:71,OP_CREF:72,OP_BRAZERO:73,OP_BRAMINZERO:74,\OP_BRANUMBER:75,OP_BRA:76,;uschar:t(2,4)=(0,11)real_pcre:T(25,2)=s28magic_number:(0,5),0,32;size:(15,2),32,32;tables:(2,5)=*(2,6)=k(0,11),64,32;options:(0,5),96,32;top_bracket:(0,9),128,16;top_backref:(0,9),144,16;first_byte:(0,9),160,16;req_byte:(0,9),176,16;name_entry_size:(0,9),192,16;name_count:(0,9),208,16;;real_pcre:t(2,7)=(25,2)pcre_study_data:T(2,8)=s40size:(15,2),0,32;options:(2,4),32,8;start_bits:(2,9)=ar(13,3);0;31;(2,4),40,256;;pcre_study_data:t(2,10)=(2,8)compile_data:T(2,11)=s44lcc:(2,12)=*(2,13)=k(2,4),0,32;fcc:(2,12),32,32;cbits:(2,12),64,32;ctypes:(2,12),96,32;start_code:(2,12),128,32;name_table:(2,14)=*(2,4),160,32;names_found:(0,1),192,32;name_entry_size:(0,1),224,32;top_backref:(0,1),256,32;backref_map:(0,4),288,32;req_varyopt:(0,1),320,32;;compile_data:t(2,15)=(2,11)branch_chain:T(2,16)=s8outer:(2,17)=*(2,16),0,32;current:(2,14),32,32;;branch_chain:t(2,18)=(2,16)recursion_info:T(2,19)=s24prevrec:(2,20)=*(2,19),0,32;group_num:(0,1),32,32;after_call:(2,12),64,32;save_start:(2,12),96,32;offset_save:(25,6),128,32;saved_max:(0,1),160,32;;recursion_info:t(2,21)=(2,19)match_data:T(2,22)=s96match_call_count:(0,5),0,32;match_limit:(0,5),32,32;offset_vector:(25,6),64,32;offset_end:(0,1),96,32;offset_max:(0,1),128,32;lcc:(2,12),160,32;ctypes:(2,12),192,32;offset_overflow:(2,1),224,32;notbol:(2,1),256,32;noteol:(2,1),288,32;utf8:(2,1),320,32;endonly:(2,1),352,32;notempty:(2,1),384,32;start_code:(2,12),416,32;start_subject:(2,12),448,32;end_subject:(2,12),480,32;start_match:(2,12),512,32;end_match_ptr:(2,12),544,32;end_offset_top:(0,1),576,32;capture_last:(0,1),608,32;start_offset:(0,1),640,32;recursive:(2,23)=*(2,21),672,32;callout_data:(18,2),704,32;thisframe:(2,24)=*(2,25)=xsheapframe:,736,32;;match_data:t(2,26)=(2,22)eptrblock:T(1,1)=s8epb_prev:(1,2)=*(1,1),0,32;epb_saved_eptr:(2,12),32,32;;eptrblock:t(1,3)=(1,1)chartables.cpcre_version:F(25,7)pcre_info:F(0,1)external_re:P(1,4)=*(1,5)=k(25,1)optptr:P(25,6)first_byte:P(25,6)pcre_fullinfo:F(0,1)external_re:P(1,4)extra_data:P(1,6)=*(1,7)=k(25,4)what:P(0,1)where:P(18,2)study:r(1,8)=*(1,9)=k(2,10)pcre_config:F(0,1)what:P(0,1)where:P(18,2)check_escape:f(0,1)ptrptr:P(1,10)=*(2,12)errorptr:P(1,11)=*(25,7)bracount:P(0,1)options:P(0,1)isclass:P(2,1)ptr:r(2,12)c:r(0,1)i:r(0,1)oldptr:r(2,12)oldptr:r(2,12)cc:r(0,1)cc:r(0,1)is_counted_repeat:f(2,1)p:P(2,12)read_repeat_counts:f(2,12)p:P(2,12)minp:P(25,6)maxp:P(25,6)errorptr:P(1,11)min:r(0,1)max:r(0,1)first_significant_code:f(2,12)code:P(2,12)options:P(25,6)optbit:P(0,1)find_fixedlength:f(0,1)code:P(2,14)options:P(0,1)length:r(0,1)branchlength:r(0,1)cc:r(2,14)d:r(0,1)op:r(0,1)find_bracket:f(2,12)code:P(2,12)utf8:P(2,1)number:P(0,1)c:r(0,1)n:r(0,1)find_recurse:f(2,12)code:P(2,12)utf8:P(2,1)c:r(0,1)could_be_empty_branch:f(2,1)code:P(2,12)endcode:P(2,12)utf8:P(2,1)c:r(0,1)ccode:r(2,12)empty_branch:r(2,1)ccode:r(2,12)empty_branch:r(2,1)could_be_empty:f(2,1)code:P(2,12)endcode:P(2,12)bcptr:P(1,12)=*(2,18)utf8:P(2,1)check_posix_syntax:f(2,1)ptr:P(2,12)endptr:P(1,10)cd:P(1,13)=*(2,15)terminator:r(0,1)check_posix_name:f(0,1)ptr:P(2,12)len:P(0,1)yield:r(0,1)adjust_recurse:f(0,22)group:P(2,14)adjust:P(0,1)utf8:P(2,1)cd:P(1,13)ptr:r(2,14)offset:r(0,1)offset:r(0,1)compile_branch:f(2,1)optionsptr:p(25,6)brackets:p(25,6)codeptr:p(1,14)=*(2,14)ptrptr:p(1,10)errorptr:p(1,11)firstbyteptr:p(25,6)reqbyteptr:p(25,6)bcptr:p(1,12)cd:p(1,13)reqbyteptr:r(25,6)cd:r(1,13)repeat_type:r(0,1)op_type:r(0,1)repeat_min:(0,1)repeat_max:(0,1)bravalue:(0,1)length:r(0,1)greedy_default:(0,1)greedy_non_default:(0,1)firstbyte:r(0,1)reqbyte:r(0,1)zeroreqbyte:(0,1)zerofirstbyte:(0,1)req_caseopt:(0,1)reqvary:(0,1)tempreqvary:r(0,1)condcount:r(0,1)options:r(0,1)c:r(0,1)code:r(2,14)tempcode:(2,14)inescq:r(2,1)groupsetfirstbyte:(2,1)ptr:(2,12)tempptr:(2,12)previous:r(2,14)class:(2,9)negate_class:(2,1)possessive_quantifier:(2,1)class_charcount:r(0,1)class_lastchar:(0,1)newoptions:(0,1)recno:r(0,1)skipbytes:(0,1)subreqbyte:(0,1)subfirstbyte:(0,1)negate_class:(2,1)possessive_quantifier:(2,1)class_charcount:r(0,1)class_lastchar:(0,1)newoptions:(0,1)recno:r(0,1)skipbytes:(0,1)subreqbyte:(0,1)subfirstbyte:(0,1)tc:r(2,14)negate_class:(2,1)possessive_quantifier:(2,1)class_charcount:r(0,1)class_lastchar:(0,1)newoptions:(0,1)recno:r(0,1)skipbytes:(0,1)subreqbyte:(0,1)subfirstbyte:(0,1)tc:r(2,14)set:(0,1)unset:(0,1)optset:r(25,6)negate_class:(2,1)possessive_quantifier:(2,1)class_charcount:r(0,1)class_lastchar:(0,1)newoptions:(0,1)recno:r(0,1)skipbytes:(0,1)subreqbyte:(0,1)subfirstbyte:(0,1)set:(0,1)unset:(0,1)optset:r(25,6)condref:r(0,1)n:r(0,1)called:r(2,12)number:r(0,1)set:(0,1)unset:(0,1)optset:r(25,6)called:r(2,12)n:r(0,1)n:r(0,1)n:r(0,1)i:r(0,1)namelen:r(0,1)type:r(0,1)name:r(2,12)slot:r(2,14)i:r(0,1)namelen:r(0,1)slot:r(2,14)crc:r(0,1)crc:r(0,1)crc:r(0,1)len:r(0,1)len:r(0,1)i:r(0,1)ketoffset:(0,1)len:r(0,1)bralink:r(2,14)i:r(0,1)ketoffset:(0,1)len:r(0,1)bralink:r(2,14)i:r(0,1)ketoffset:(0,1)len:r(0,1)bralink:r(2,14)offset:r(0,1)oldlinkoffset:r(0,1)offset:r(0,1)bra:r(2,14)oldlinkoffset:r(0,1)offset:r(0,1)bra:r(2,14)offset:r(0,1)ket:r(2,14)d:r(0,1)uc:r(0,1)cbits:r(2,12)local_negate:(2,1)posix_class:r(0,1)i:r(0,1)cbits:r(2,12)taboffset:r(0,1)taboffset:r(0,1)number:r(0,1)compile_regex:f(2,1)options:p(0,1)oldims:P(0,1)brackets:P(25,6)codeptr:p(1,14)ptrptr:p(1,10)errorptr:P(1,11)lookbehind:p(2,1)skipbytes:p(0,1)firstbyteptr:p(25,6)reqbyteptr:p(25,6)bcptr:p(1,12)cd:p(1,13)lookbehind:r(2,1)skipbytes:r(0,1)firstbyteptr:r(25,6)reqbyteptr:r(25,6)bcptr:r(1,12)cd:r(1,13)ptr:(2,12)code:(2,14)last_branch:r(2,14)reverse_count:r(2,14)firstbyte:r(0,1)reqbyte:r(0,1)branchfirstbyte:(0,1)branchreqbyte:(0,1)bc:(2,18)length:r(0,1)prev_length:r(0,1)prev_length:r(0,1)length:r(0,1)is_anchored:f(2,1)code:P(2,12)options:P(25,6)bracket_map:P(0,4)backref_map:P(0,4)scode:r(2,12)op:r(0,1)new_map:r(0,1)scode:r(2,12)op:r(0,1)scode:r(2,12)op:r(0,1)is_startline:f(2,1)code:P(2,12)bracket_map:P(0,4)backref_map:P(0,4)scode:r(2,12)op:r(0,1)new_map:r(0,1)scode:r(2,12)op:r(0,1)scode:r(2,12)op:r(0,1)find_firstassertedchar:f(0,1)code:P(2,12)options:P(25,6)inassert:P(2,1)c:r(0,1)d:r(0,1)scode:r(2,12)op:r(0,1)d:r(0,1)scode:r(2,12)op:r(0,1)d:r(0,1)scode:r(2,12)op:r(0,1)pcre_compile:F(1,15)=*(25,1)pattern:P(25,7)options:P(0,1)errorptr:P(1,11)erroroffset:P(25,6)tables:P(2,5)re:r(1,16)=*(2,7)length:r(0,1)runlength:r(0,1)c:r(0,1)firstbyte:(0,1)reqbyte:(0,1)bracount:(0,1)branch_extra:r(0,1)branch_newextra:r(0,1)item_count:r(0,1)name_count:r(0,1)max_name_size:(0,1)inescq:r(2,1)brastackptr:(0,4)size:r(15,2)code:(2,14)codestart:r(2,12)ptr:(2,12)compile_block:(2,15)brastack:(1,17)=ar(13,3);0;199;(0,1)bralenstack:(1,18)=ar(13,3);0;199;(2,4)min:(0,1)max:(0,1)class_optcount:r(0,1)bracket_length:r(0,1)duplength:r(0,1)min:(0,1)max:(0,1)class_optcount:r(0,1)bracket_length:r(0,1)duplength:r(0,1)temp_options:(0,1)ch:r(0,1)ch:r(0,1)ch:r(0,1)temp_options:(0,1)ch:r(0,1)min:(0,1)max:(0,1)class_optcount:r(0,1)bracket_length:r(0,1)duplength:r(0,1)save_ptr:r(2,12)saveptr:r(2,12)refnum:r(0,1)refnum:r(0,1)set:(0,1)unset:(0,1)optset:r(25,6)min:(0,1)max:(0,1)class_optcount:r(0,1)bracket_length:r(0,1)duplength:r(0,1)set:(0,1)unset:(0,1)optset:r(25,6)ch:r(0,1)match_ref:f(2,1)offset:P(0,1)eptr:P(2,12)length:P(0,1)md:P(1,19)=*(2,26)ims:P(0,5)p:r(2,12)match:f(0,1)eptr:P(2,12)ecode:P(2,12)offset_top:P(0,1)md:P(1,19)ims:P(0,5)eptrb:P(1,20)=*(1,3)flags:p(0,1)rrc:r(0,1)i:r(0,1)c:r(0,1)callpat:r(2,12)data:r(2,12)next:r(2,12)pp:r(2,12)prev:r(2,12)saved_eptr:r(2,12)new_recursive:(2,21)cur_is_word:r(2,1)condition:r(2,1)minimize:r(2,1)prev_is_word:r(2,1)original_ims:(0,5)ctype:r(0,1)length:r(0,1)max:r(0,1)min:r(0,1)number:r(0,1)offset:r(0,1)op:r(0,1)save_capture_last:r(0,1)save_offset1:r(0,1)save_offset2:r(0,1)save_offset3:r(0,1)stacksave:(1,21)=ar(13,3);0;29;(0,1)newptrb:(1,3)slen:r(0,1)cb:(25,9)pcre_exec:F(0,1)external_re:P(1,4)extra_data:P(1,6)subject:P(25,7)length:P(0,1)start_offset:P(0,1)options:P(0,1)offsets:p(25,6)offsetcount:p(0,1)offsets:r(25,6)offsetcount:r(0,1)rc:r(0,1)resetcount:r(0,1)ocount:r(0,1)first_byte:r(0,1)req_byte:r(0,1)req_byte2:(0,1)ims:(0,5)using_temporary_offsets:(2,1)anchored:(2,1)startline:(2,1)first_byte_caseless:(2,1)req_byte_caseless:(2,1)match_block:(2,26)start_bits:(2,12)start_match:r(2,12)req_byte_ptr:(2,12)study:r(1,8)flags:r(0,4)iptr:r(25,6)iend:r(25,6)iptr:r(25,6)iend:r(25,6)p:r(2,12)pp:r(0,1)pp:r(0,1)iptr:r(25,6)iend:r(25,6)p:r(2,12)iptr:r(25,6)iend:r(25,6)p:r(2,12)c:r(0,1)c:r(0,1)pcre_malloc:G(1,22)=*(1,23)=f(18,2)pcre_free:G(1,24)=*(1,25)=f(0,22)pcre_stack_malloc:G(1,22)pcre_stack_free:G(1,24)pcre_callout:G(1,26)=*(1,27)=f(0,1)OP_lengths:S(1,28)=ar(13,3);0;76;(2,13)rep_min:S(1,29)=ar(13,3);0;5;(25,8)rep_max:S(1,30)=ar(13,3);0;5;(25,8)escapes:S(1,31)=ar(13,3);0;74;(1,32)=k(0,8)posix_names:S(1,33)=ar(13,3);0;13;(1,34)=k(25,7)posix_name_lengths:S(1,35)=ar(13,3);0;14;(2,13)posix_class_maps:S(1,36)=ar(13,3);0;41;(1,37)=k(0,1)digitab:S(1,38)=ar(13,3);0;255;(2,6)pcre_default_tables:S(1,39)=ar(13,3);0;1087;(0,11)` "`o %B$$ =B0 LB  VB   ` fhh ans xhh8@ Pk @D u(p vws07070100005913000081a40000000a0000000a00000001402cbcbc0000418c0000008800000005000000000000000000000019ff350889reloc/lib/libpcreposix.a! / 1076671892 0 0 0 56 ` ||||regcompregexecregerrorregfreepcreposix.o/ 1076671890 10 10 100644 16596 ` ELF>4( .shstrtab.text.rodata.stab.stabstr.symtab.strtab.rela.text.rela.rodata.rela.stab.comment㿐` , @@   +(,  `@㿐 `. `@ @` !`` @  : `@ (@`0 㿐`@㿈   2`@蚒 & &0 @ &       2a?$ xN@#\#` @ "`#  / @&   `0 ?/  & `& @` `  (``@     @`  @*   \ at end of pattern\c at end of patternunrecognized character follows \numbers out of order in {} quantifiernumber too big in {} quantifiermissing terminating ] for character classinvalid escape sequence in character classrange out of order in character classnothing to repeatoperand of unlimited repeat could match the empty stringinternal error: unexpected repeatunrecognized character after (?POSIX named classes are supported only within a classmissing )reference to non-existent subpatternerroffset passed as NULLunknown option bit(s) setmissing ) after commentparentheses nested too deeplyregular expression too largefailed to get memoryunmatched parenthesesinternal error: code overflowunrecognized character after (?<lookbehind assertion is not fixed lengthmalformed number after (?(conditional group contains more than two branches(?R or (?digits must be followed by )unknown POSIX class namePOSIX collating elements are not supportedthis version of PCRE is not compiled with PCRE_UTF8 supportspare errorcharacter value in \x{...} sequence is too largeinvalid condition (?(0)\C not allowed in lookbehind assertionPCRE does not support \L, \l, \N, \P, \p, \U, \u, or \Xnumber after (?C is > 255closing ) for (?C expectedrecursive call could loop indefinitelyunrecognized character after (?Psyntax error after (?Ptwo named groups have the same nameinvalid UTF-8 string      internal errorinvalid repeat counts in {}pattern error? * + invalidunbalanced {}unbalanced []collation error - not relevantbad classbad escape sequenceempty expressionunbalanced ()bad range inside []expression too bigbad back referencebad argumentmatch failedunknown error code at offset %s%s%-6d d(d4<CmW3brȀ?dĂق3vڂ #AE+Ղ+6UMEӂ2MnԂ  ؀; K X i 0q G{ _ u < A 3G oO m ߀ Rw l À ՀvՀ-e5FʀN.݀ZwBFKJ$g@DDDD DD0D<DPq@P{$X|$@@@@DDD$D,D0D4D8D\DhDDDD@@@@$$%$5@DDI$ J$Y@e@u@DDDD$D0D8D<D@DDDDDXDhDl@ l$t$@@@@@DDD DDD D,D0D4D8D@D PDDDDDDDDDDDDD D!(D#PD+XD)`D,hDDDDDD/@@)@9xa@z@$&.&5&fdpcreposix.c/usr2/SOURCES/S9/pcre-4.5/pcreposix.cgcc2_compiled.int:t(0,1)=r(0,1);-2147483648;2147483647;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,3);-2147483648;2147483647;unsigned int:t(0,4)=r(0,4);000000000000000000000000;000000000000037777777777;long unsigned int:t(0,5)=r(0,5);000000000000000000000000;000000000000037777777777;long long int:t(0,6)=@s64;r(0,6);001000000000000000000000;000777777777777777777777;long long unsigned int:t(0,7)=@s64;r(0,7);000000000000000000000000;001777777777777777777777;short int:t(0,8)=@s16;r(0,8);-32768;32767;short unsigned int:t(0,9)=@s16;r(0,9);0;65535;signed char:t(0,10)=@s8;r(0,10);-128;127;unsigned char:t(0,11)=@s8;r(0,11);0;255;__int128_t:t(0,12)=@s128;r(0,12);000000000000000000000000;0377777777777777777777777777777777;__uint128_t:t(0,13)=@s128;r(0,13);000000000000000000000000;0377777777777777777777777777777777;float:t(0,14)=r(0,1);4;0;double:t(0,15)=r(0,1);8;0;long double:t(0,16)=r(0,1);16;0;complex int:t(0,17)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,18)=R3;8;0;complex double:t(0,19)=R4;16;0;complex long double:t(0,20)=R5;32;0;__builtin_va_list:t(0,21)=*(0,22)=(0,22)_Bool:t(0,23)=@s8;-16;pcreposix.cinternal.hconfig.h/usr/include/ctype.h/usr/include/iso/ctype_iso.h/usr/include/sys/feature_tests.h/usr/include/sys/isa_defs.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/limits.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/syslimits.h/usr/include/iso/limits_iso.h/usr/include/sys/int_limits.hclock_t:t(9,1)=(0,3)/usr/include/setjmp.h/usr/include/iso/setjmp_iso.hjmp_buf:t(13,1)=(13,2)=ar(13,3)=r(13,3);000000000000000000000000;000000000000037777777777;;0;11;(0,1)sigjmp_buf:t(12,1)=(12,2)=ar(13,3);0;18;(0,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdarg.h__gnuc_va_list:t(14,1)=(0,21)va_list:t(14,2)=(14,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stddef.hptrdiff_t:t(15,1)=(0,1)size_t:t(15,2)=(0,4)wchar_t:t(15,3)=(0,3)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio.h/usr/include/iso/stdio_iso.h/usr/include/sys/va_list.h__va_list:t(18,1)=(18,2)=*(0,22)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio_tag.h__FILE:t(19,1)=(19,2)=xs__FILE:/usr/include/stdio_impl.hssize_t:t(20,1)=(0,1)__FILE:T(19,2)=s16_cnt:(20,1),0,32;_ptr:(20,2)=*(0,11),32,32;_base:(20,2),64,32;_flag:(0,11),96,8;_file:(0,11),104,8;__orientation:(0,4),112,2;__ionolock:(0,4),114,1;__seekable:(0,4),115,1;__filler:(0,4),116,4;;__longlong_t:t(17,1)=(0,6)FILE:t(17,2)=(19,1)fpos_t:t(17,3)=(0,3)off_t:t(16,1)=(0,3)off64_t:t(16,2)=(17,1)fpos64_t:t(16,3)=(17,1)/usr/include/stdlib.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/iso/stdlib_iso.hdiv_t:t(22,1)=(22,2)=s8quot:(0,1),0,32;rem:(0,1),32,32;;ldiv_t:t(22,3)=(22,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;lldiv_t:t(21,1)=(21,2)=s16quot:(0,6),0,64;rem:(0,6),64,64;;uid_t:t(21,3)=(0,3)/usr/include/string.h/usr/include/iso/string_iso.hpcre.hpcre:t(25,1)=(25,2)=xsreal_pcre:pcre_extra:T(25,3)=s16flags:(0,5),0,32;study_data:(18,2),32,32;match_limit:(0,5),64,32;callout_data:(18,2),96,32;;pcre_extra:t(25,4)=(25,3)pcre_callout_block:T(25,5)=s40version:(0,1),0,32;callout_number:(0,1),32,32;offset_vector:(25,6)=*(0,1),64,32;subject:(25,7)=*(25,8)=k(0,2),96,32;subject_length:(0,1),128,32;start_match:(0,1),160,32;current_position:(0,1),192,32;capture_top:(0,1),224,32;capture_last:(0,1),256,32;callout_data:(18,2),288,32;;pcre_callout_block:t(25,9)=(25,5)BOOL:t(2,1)=(0,1) :T(2,2)=eESC_A:1,ESC_G:2,ESC_B:3,ESC_b:4,ESC_D:5,ESC_d:6,ESC_S:7,ESC_s:8,ESC_W:9,ESC_w:10,ESC_dum1:11,ESC_C:12,ESC_Z:13,ESC_z:14,ESC_E:15,ESC_Q:16,ESC_REF:17,; :T(2,3)=eOP_END:0,OP_SOD:1,OP_SOM:2,OP_NOT_WORD_BOUNDARY:3,OP_WORD_BOUNDARY:4,OP_NOT_DIGIT:5,OP_DIGIT:6,OP_NOT_WHITESPACE:7,OP_WHITESPACE:8,OP_NOT_WORDCHAR:9,OP_WORDCHAR:10,OP_ANY:11,OP_ANYBYTE:12,OP_EODN:13,OP_EOD:14,OP_OPT:15,OP_CIRC:16,OP_DOLL:17,OP_CHARS:18,OP_NOT:19,OP_STAR:20,OP_MINSTAR:21,OP_PLUS:22,OP_MINPLUS:23,OP_QUERY:24,OP_MINQUERY:25,OP_UPTO:26,OP_MINUPTO:27,OP_EXACT:28,OP_NOTSTAR:29,OP_NOTMINSTAR:30,OP_NOTPLUS:31,OP_NOTMINPLUS:32,OP_NOTQUERY:33,OP_NOTMINQUERY:34,OP_NOTUPTO:35,OP_NOTMINUPTO:36,OP_NOTEXACT:37,OP_TYPESTAR:38,OP_TYPEMINSTAR:39,OP_TYPEPLUS:40,OP_TYPEMINPLUS:41,OP_TYPEQUERY:42,OP_TYPEMINQUERY:43,OP_TYPEUPTO:44,OP_TYPEMINUPTO:45,OP_TYPEEXACT:46,OP_CRSTAR:47,OP_CRMINSTAR:48,OP_CRPLUS:49,OP_CRMINPLUS:50,OP_CRQUERY:51,OP_CRMINQUERY:52,OP_CRRANGE:53,OP_CRMINRANGE:54,OP_CLASS:55,OP_NCLASS:56,OP_XCLASS:57,OP_REF:58,OP_RECURSE:59,OP_CALLOUT:60,OP_ALT:61,OP_KET:62,OP_KETRMAX:63,OP_KETRMIN:64,OP_ASSERT:65,OP_ASSERT_NOT:66,OP_ASSERTBACK:67,OP_ASSERTBACK_NOT:68,OP_REVERSE:69,OP_ONCE:70,OP_COND:71,OP_CREF:72,OP_BRAZERO:73,OP_BRAMINZERO:74,\OP_BRANUMBER:75,OP_BRA:76,;uschar:t(2,4)=(0,11)real_pcre:T(25,2)=s28magic_number:(0,5),0,32;size:(15,2),32,32;tables:(2,5)=*(2,6)=k(0,11),64,32;options:(0,5),96,32;top_bracket:(0,9),128,16;top_backref:(0,9),144,16;first_byte:(0,9),160,16;req_byte:(0,9),176,16;name_entry_size:(0,9),192,16;name_count:(0,9),208,16;;real_pcre:t(2,7)=(25,2)pcre_study_data:T(2,8)=s40size:(15,2),0,32;options:(2,4),32,8;start_bits:(2,9)=ar(13,3);0;31;(2,4),40,256;;pcre_study_data:t(2,10)=(2,8)compile_data:T(2,11)=s44lcc:(2,12)=*(2,13)=k(2,4),0,32;fcc:(2,12),32,32;cbits:(2,12),64,32;ctypes:(2,12),96,32;start_code:(2,12),128,32;name_table:(2,14)=*(2,4),160,32;names_found:(0,1),192,32;name_entry_size:(0,1),224,32;top_backref:(0,1),256,32;backref_map:(0,4),288,32;req_varyopt:(0,1),320,32;;compile_data:t(2,15)=(2,11)branch_chain:T(2,16)=s8outer:(2,17)=*(2,16),0,32;current:(2,14),32,32;;branch_chain:t(2,18)=(2,16)recursion_info:T(2,19)=s24prevrec:(2,20)=*(2,19),0,32;group_num:(0,1),32,32;after_call:(2,12),64,32;save_start:(2,12),96,32;offset_save:(25,6),128,32;saved_max:(0,1),160,32;;recursion_info:t(2,21)=(2,19)match_data:T(2,22)=s96match_call_count:(0,5),0,32;match_limit:(0,5),32,32;offset_vector:(25,6),64,32;offset_end:(0,1),96,32;offset_max:(0,1),128,32;lcc:(2,12),160,32;ctypes:(2,12),192,32;offset_overflow:(2,1),224,32;notbol:(2,1),256,32;noteol:(2,1),288,32;utf8:(2,1),320,32;endonly:(2,1),352,32;notempty:(2,1),384,32;start_code:(2,12),416,32;start_subject:(2,12),448,32;end_subject:(2,12),480,32;start_match:(2,12),512,32;end_match_ptr:(2,12),544,32;end_offset_top:(0,1),576,32;capture_last:(0,1),608,32;start_offset:(0,1),640,32;recursive:(2,23)=*(2,21),672,32;callout_data:(18,2),704,32;thisframe:(2,24)=*(2,25)=xsheapframe:,736,32;;match_data:t(2,26)=(2,22)pcreposix.h :T(26,1)=eREG_ASSERT:1,REG_BADBR:2,REG_BADPAT:3,REG_BADRPT:4,REG_EBRACE:5,REG_EBRACK:6,REG_ECOLLATE:7,REG_ECTYPE:8,REG_EESCAPE:9,REG_EMPTY:10,REG_EPAREN:11,REG_ERANGE:12,REG_ESIZE:13,REG_ESPACE:14,REG_ESUBREG:15,REG_INVARG:16,REG_NOMATCH:17,;regex_t:t(26,2)=(26,3)=s12re_pcre:(18,2),0,32;re_nsub:(15,2),32,32;re_erroffset:(15,2),64,32;;regoff_t:t(26,4)=(0,1)regmatch_t:t(26,5)=(26,6)=s8rm_so:(26,4),0,32;rm_eo:(26,4),32,32;;pcre_posix_error_code:f(0,1)s:P(25,7)i:r(15,2)regerror:F(15,2)errcode:P(0,1)preg:P(1,1)=*(1,2)=k(26,2)errbuf:P(1,3)=*(0,2)errbuf_size:P(15,2)message:r(25,7)addmessage:r(25,7)length:r(15,2)addlength:r(15,2)regfree:F(0,22)preg:P(1,4)=*(26,2)regcomp:F(0,1)preg:P(1,4)pattern:P(25,7)cflags:P(0,1)errorptr:(25,7)erroffset:(0,1)options:r(0,1)regexec:F(0,1)preg:P(1,1)string:P(25,7)nmatch:P(15,2)pmatch:P(1,5)=*(26,5)eflags:P(0,1)rc:r(0,1)options:r(0,1)ovector:r(25,6)small_ovector:(1,6)=ar(13,3);0;29;(0,1)allocated_ovector:r(2,1)i:r(15,2)estring:S(1,7)=ar(13,3);0;43;(1,8)=k(25,7)eint:S(1,9)=ar(13,3);0;43;(1,10)=k(0,1)pstring:S(1,11)=ar(13,3);0;17;(1,8) X#(00H8ELDtT^fnxX$ pcreposix.cpcre_posix_error_codeeintestringpstringpcre_compilestrlenregcomppcre_execstrncpyregexecpcre_infomallocregerrorstrcmppcre_freesprintffreeregfree 0  0D H \ (h (p t |  @ @  P  P( , t  0  \ \(@\`d hl pt x|0480<X@DHLP(T@X\`dhl8pXtxx| HxHHh ( 8 P h x     $    0   as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.24d  Y |  ((7( 0889X C;, P> [>\07070100005914000081a40000000a0000000a00000001402cbcbc000002ff000000880000000500000000000000000000001aff350889reloc/lib/libpcreposix.la# libpcreposix.la - a libtool library file # Generated by ltmain.sh - GNU libtool 1.4.3 (1.922.2.110 2002/10/23 01:39:54) # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='libpcreposix.so.0' # Names of this library. library_names='libpcreposix.so.0.0.0 libpcreposix.so.0 libpcreposix.so' # The name of the static archive. old_library='libpcreposix.a' # Libraries that this one depends upon. dependency_libs=' /usr/local/lib/libpcre.la' # Version information for libpcreposix. current=0 age=0 revision=0 # Is this an already installed library? installed=yes # Files to dlopen/dlpreopen dlopen='' dlpreopen='' # Directory that this library needs to be installed in: libdir='/usr/local/lib' 07070100005915000081a40000000a0000000a00000001402cbcbc000049000000008800000005000000000000000000000020ff350889reloc/lib/libpcreposix.so.0.0.0ELF4E4 (xx    $149 tA [c l<qx} <  sprintfpcre_execpcre_info_etextpcre_compileregfreeregcomp_PROCEDURE_LINKAGE_TABLE_strncpy_DYNAMIC_endmallocfreestrlen_GLOBAL_OFFSET_TABLE__edataregerrorregexecpcre_freestrcmplibc.so.1SYSVABI_1.3libpcre.so.0libc.so.1libpcreposix.so.0/usr/local/lib7̳D `H xL P T X \ 0` `d h l p t (x `| p    0H`00Xx0Hp8Px@HXx  $((@,00X4p8D , 8DP\h t 㿐/C<``  , @C   +(,  㿐/BЀ 1`.  @C`` "` @B  : `@B(` @B0 `㿐/B`@@㿈   2`@B蚒 & &0 @B &  /B|<     2a?$ xO@B#\#` @B "`#  / @&   `1 ?/  & `' @Bt`  * B`% @      @BZ`  @BW*   \ at end of pattern\c at end of patternunrecognized character follows \numbers out of order in {} quantifiernumber too big in {} quantifiermissing terminating ] for character classinvalid escape sequence in character classrange out of order in character classnothing to repeatoperand of unlimited repeat could match the empty stringinternal error: unexpected repeatunrecognized character after (?POSIX named classes are supported only within a classmissing )reference to non-existent subpatternerroffset passed as NULLunknown option bit(s) setmissing ) after commentparentheses nested too deeplyregular expression too largefailed to get memoryunmatched parenthesesinternal error: code overflowunrecognized character after (?<lookbehind assertion is not fixed lengthmalformed number after (?(conditional group contains more than two branches(?R or (?digits must be followed by )unknown POSIX class namePOSIX collating elements are not supportedthis version of PCRE is not compiled with PCRE_UTF8 supportspare errorcharacter value in \x{...} sequence is too largeinvalid condition (?(0)\C not allowed in lookbehind assertionPCRE does not support \L, \l, \N, \P, \p, \U, \u, or \Xnumber after (?C is > 255closing ) for (?C expectedrecursive call could loop indefinitelyunrecognized character after (?Psyntax error after (?Ptwo named groups have the same nameinvalid UTF-8 string      internal errorinvalid repeat counts in {}pattern error? * + invalidunbalanced {}unbalanced []collation error - not relevantbad classbad escape sequenceempty expressionunbalanced ()bad range inside []expression too bigbad back referencebad argumentmatch failedunknown error code at offset %s%s%-6d00<0H0T0`0l0x000 L oool  ooL x `    D <iq<) 0 7 >lT YD aH w 4 t  < <  (2.libs/libpcreposix.so.0.0.0pcreposix.c.LLC60.LLC61.LLC62pcre_posix_error_codeeintestringpstring_START__END_sprintfpcre_execpcre_info_etextpcre_compileregfreeregcomp_PROCEDURE_LINKAGE_TABLE_strncpy_DYNAMIC_endmallocfreestrlen_GLOBAL_OFFSET_TABLE__edataregerrorregexecpcre_freestrcmp dx(dx4<CmW3brȀ?dĂق3vڂ #AE+Ղ+6UMEӂ2MnԂ  ؀; K X i 0q G{ _ u < A 3G oO m ߀ Rw l À ՀvՀ-e5FʀN.݀ZwBFKJ$g@DDD(D,D0DLDXDdq@,d{$l|$@@@@DDDDD0D8D<D@DDDHDlDxDDDD@@@@$$%$5@DDD D I$4J$ Y@e@u@DDDD$D0D8D<D@DDDDDXDhDl@ l$t$ @@@@@DDDDD D,D8D<D@DDDLD \DDDDDDDDDDDDD (D!4D#`D+hD)pD,xDDDDDD/@@)@9xa@z@($&.D&5&fd `as: Sun WorkShop 6 update 2 Compiler Common 6.2 Solaris_9_CBE 2001/04/02 GCC: (GNU) 3.3.2.hash.dynsym.dynstr.SUNW_version.rela.data.rel.ro.local.rela.got.rela.plt.text.rodata.got.plt.dynamic.data.rel.ro.local.bss.symtab.strtab.stab.comment.shstrtab.stabstrpcreposix.c/usr2/SOURCES/S9/pcre-4.5/pcreposix.cgcc2_compiled.int:t(0,1)=r(0,1);-2147483648;2147483647;char:t(0,2)=r(0,2);0;127;long int:t(0,3)=r(0,3);-2147483648;2147483647;unsigned int:t(0,4)=r(0,4);000000000000000000000000;000000000000037777777777;long unsigned int:t(0,5)=r(0,5);000000000000000000000000;000000000000037777777777;long long int:t(0,6)=@s64;r(0,6);001000000000000000000000;000777777777777777777777;long long unsigned int:t(0,7)=@s64;r(0,7);000000000000000000000000;001777777777777777777777;short int:t(0,8)=@s16;r(0,8);-32768;32767;short unsigned int:t(0,9)=@s16;r(0,9);0;65535;signed char:t(0,10)=@s8;r(0,10);-128;127;unsigned char:t(0,11)=@s8;r(0,11);0;255;__int128_t:t(0,12)=@s128;r(0,12);000000000000000000000000;0377777777777777777777777777777777;__uint128_t:t(0,13)=@s128;r(0,13);000000000000000000000000;0377777777777777777777777777777777;float:t(0,14)=r(0,1);4;0;double:t(0,15)=r(0,1);8;0;long double:t(0,16)=r(0,1);16;0;complex int:t(0,17)=s8real:(0,1),0,32;imag:(0,1),32,32;;complex float:t(0,18)=R3;8;0;complex double:t(0,19)=R4;16;0;complex long double:t(0,20)=R5;32;0;__builtin_va_list:t(0,21)=*(0,22)=(0,22)_Bool:t(0,23)=@s8;-16;pcreposix.cinternal.hconfig.h/usr/include/ctype.h/usr/include/iso/ctype_iso.h/usr/include/sys/feature_tests.h/usr/include/sys/isa_defs.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/limits.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/syslimits.h/usr/include/iso/limits_iso.h/usr/include/sys/int_limits.hclock_t:t(9,1)=(0,3)/usr/include/setjmp.h/usr/include/iso/setjmp_iso.hjmp_buf:t(13,1)=(13,2)=ar(13,3)=r(13,3);000000000000000000000000;000000000000037777777777;;0;11;(0,1)sigjmp_buf:t(12,1)=(12,2)=ar(13,3);0;18;(0,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdarg.h__gnuc_va_list:t(14,1)=(0,21)va_list:t(14,2)=(14,1)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stddef.hptrdiff_t:t(15,1)=(0,1)size_t:t(15,2)=(0,4)wchar_t:t(15,3)=(0,3)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio.h/usr/include/iso/stdio_iso.h/usr/include/sys/va_list.h__va_list:t(18,1)=(18,2)=*(0,22)/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/stdio_tag.h__FILE:t(19,1)=(19,2)=xs__FILE:/usr/include/stdio_impl.hssize_t:t(20,1)=(0,1)__FILE:T(19,2)=s16_cnt:(20,1),0,32;_ptr:(20,2)=*(0,11),32,32;_base:(20,2),64,32;_flag:(0,11),96,8;_file:(0,11),104,8;__orientation:(0,4),112,2;__ionolock:(0,4),114,1;__seekable:(0,4),115,1;__filler:(0,4),116,4;;__longlong_t:t(17,1)=(0,6)FILE:t(17,2)=(19,1)fpos_t:t(17,3)=(0,3)off_t:t(16,1)=(0,3)off64_t:t(16,2)=(17,1)fpos64_t:t(16,3)=(17,1)/usr/include/stdlib.h/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/iso/stdlib_iso.hdiv_t:t(22,1)=(22,2)=s8quot:(0,1),0,32;rem:(0,1),32,32;;ldiv_t:t(22,3)=(22,4)=s8quot:(0,3),0,32;rem:(0,3),32,32;;lldiv_t:t(21,1)=(21,2)=s16quot:(0,6),0,64;rem:(0,6),64,64;;uid_t:t(21,3)=(0,3)/usr/include/string.h/usr/include/iso/string_iso.hpcre.hpcre:t(25,1)=(25,2)=xsreal_pcre:pcre_extra:T(25,3)=s16flags:(0,5),0,32;study_data:(18,2),32,32;match_limit:(0,5),64,32;callout_data:(18,2),96,32;;pcre_extra:t(25,4)=(25,3)pcre_callout_block:T(25,5)=s40version:(0,1),0,32;callout_number:(0,1),32,32;offset_vector:(25,6)=*(0,1),64,32;subject:(25,7)=*(25,8)=k(0,2),96,32;subject_length:(0,1),128,32;start_match:(0,1),160,32;current_position:(0,1),192,32;capture_top:(0,1),224,32;capture_last:(0,1),256,32;callout_data:(18,2),288,32;;pcre_callout_block:t(25,9)=(25,5)BOOL:t(2,1)=(0,1) :T(2,2)=eESC_A:1,ESC_G:2,ESC_B:3,ESC_b:4,ESC_D:5,ESC_d:6,ESC_S:7,ESC_s:8,ESC_W:9,ESC_w:10,ESC_dum1:11,ESC_C:12,ESC_Z:13,ESC_z:14,ESC_E:15,ESC_Q:16,ESC_REF:17,; :T(2,3)=eOP_END:0,OP_SOD:1,OP_SOM:2,OP_NOT_WORD_BOUNDARY:3,OP_WORD_BOUNDARY:4,OP_NOT_DIGIT:5,OP_DIGIT:6,OP_NOT_WHITESPACE:7,OP_WHITESPACE:8,OP_NOT_WORDCHAR:9,OP_WORDCHAR:10,OP_ANY:11,OP_ANYBYTE:12,OP_EODN:13,OP_EOD:14,OP_OPT:15,OP_CIRC:16,OP_DOLL:17,OP_CHARS:18,OP_NOT:19,OP_STAR:20,OP_MINSTAR:21,OP_PLUS:22,OP_MINPLUS:23,OP_QUERY:24,OP_MINQUERY:25,OP_UPTO:26,OP_MINUPTO:27,OP_EXACT:28,OP_NOTSTAR:29,OP_NOTMINSTAR:30,OP_NOTPLUS:31,OP_NOTMINPLUS:32,OP_NOTQUERY:33,OP_NOTMINQUERY:34,OP_NOTUPTO:35,OP_NOTMINUPTO:36,OP_NOTEXACT:37,OP_TYPESTAR:38,OP_TYPEMINSTAR:39,OP_TYPEPLUS:40,OP_TYPEMINPLUS:41,OP_TYPEQUERY:42,OP_TYPEMINQUERY:43,OP_TYPEUPTO:44,OP_TYPEMINUPTO:45,OP_TYPEEXACT:46,OP_CRSTAR:47,OP_CRMINSTAR:48,OP_CRPLUS:49,OP_CRMINPLUS:50,OP_CRQUERY:51,OP_CRMINQUERY:52,OP_CRRANGE:53,OP_CRMINRANGE:54,OP_CLASS:55,OP_NCLASS:56,OP_XCLASS:57,OP_REF:58,OP_RECURSE:59,OP_CALLOUT:60,OP_ALT:61,OP_KET:62,OP_KETRMAX:63,OP_KETRMIN:64,OP_ASSERT:65,OP_ASSERT_NOT:66,OP_ASSERTBACK:67,OP_ASSERTBACK_NOT:68,OP_REVERSE:69,OP_ONCE:70,OP_COND:71,OP_CREF:72,OP_BRAZERO:73,OP_BRAMINZERO:74,\OP_BRANUMBER:75,OP_BRA:76,;uschar:t(2,4)=(0,11)real_pcre:T(25,2)=s28magic_number:(0,5),0,32;size:(15,2),32,32;tables:(2,5)=*(2,6)=k(0,11),64,32;options:(0,5),96,32;top_bracket:(0,9),128,16;top_backref:(0,9),144,16;first_byte:(0,9),160,16;req_byte:(0,9),176,16;name_entry_size:(0,9),192,16;name_count:(0,9),208,16;;real_pcre:t(2,7)=(25,2)pcre_study_data:T(2,8)=s40size:(15,2),0,32;options:(2,4),32,8;start_bits:(2,9)=ar(13,3);0;31;(2,4),40,256;;pcre_study_data:t(2,10)=(2,8)compile_data:T(2,11)=s44lcc:(2,12)=*(2,13)=k(2,4),0,32;fcc:(2,12),32,32;cbits:(2,12),64,32;ctypes:(2,12),96,32;start_code:(2,12),128,32;name_table:(2,14)=*(2,4),160,32;names_found:(0,1),192,32;name_entry_size:(0,1),224,32;top_backref:(0,1),256,32;backref_map:(0,4),288,32;req_varyopt:(0,1),320,32;;compile_data:t(2,15)=(2,11)branch_chain:T(2,16)=s8outer:(2,17)=*(2,16),0,32;current:(2,14),32,32;;branch_chain:t(2,18)=(2,16)recursion_info:T(2,19)=s24prevrec:(2,20)=*(2,19),0,32;group_num:(0,1),32,32;after_call:(2,12),64,32;save_start:(2,12),96,32;offset_save:(25,6),128,32;saved_max:(0,1),160,32;;recursion_info:t(2,21)=(2,19)match_data:T(2,22)=s96match_call_count:(0,5),0,32;match_limit:(0,5),32,32;offset_vector:(25,6),64,32;offset_end:(0,1),96,32;offset_max:(0,1),128,32;lcc:(2,12),160,32;ctypes:(2,12),192,32;offset_overflow:(2,1),224,32;notbol:(2,1),256,32;noteol:(2,1),288,32;utf8:(2,1),320,32;endonly:(2,1),352,32;notempty:(2,1),384,32;start_code:(2,12),416,32;start_subject:(2,12),448,32;end_subject:(2,12),480,32;start_match:(2,12),512,32;end_match_ptr:(2,12),544,32;end_offset_top:(0,1),576,32;capture_last:(0,1),608,32;start_offset:(0,1),640,32;recursive:(2,23)=*(2,21),672,32;callout_data:(18,2),704,32;thisframe:(2,24)=*(2,25)=xsheapframe:,736,32;;match_data:t(2,26)=(2,22)pcreposix.h :T(26,1)=eREG_ASSERT:1,REG_BADBR:2,REG_BADPAT:3,REG_BADRPT:4,REG_EBRACE:5,REG_EBRACK:6,REG_ECOLLATE:7,REG_ECTYPE:8,REG_EESCAPE:9,REG_EMPTY:10,REG_EPAREN:11,REG_ERANGE:12,REG_ESIZE:13,REG_ESPACE:14,REG_ESUBREG:15,REG_INVARG:16,REG_NOMATCH:17,;regex_t:t(26,2)=(26,3)=s12re_pcre:(18,2),0,32;re_nsub:(15,2),32,32;re_erroffset:(15,2),64,32;;regoff_t:t(26,4)=(0,1)regmatch_t:t(26,5)=(26,6)=s8rm_so:(26,4),0,32;rm_eo:(26,4),32,32;;pcre_posix_error_code:f(0,1)s:P(25,7)i:r(15,2)regerror:F(15,2)errcode:P(0,1)preg:P(1,1)=*(1,2)=k(26,2)errbuf:P(1,3)=*(0,2)errbuf_size:P(15,2)message:r(25,7)addmessage:r(25,7)length:r(15,2)addlength:r(15,2)regfree:F(0,22)preg:P(1,4)=*(26,2)regcomp:F(0,1)preg:P(1,4)pattern:P(25,7)cflags:P(0,1)errorptr:(25,7)erroffset:(0,1)options:r(0,1)regexec:F(0,1)preg:P(1,1)string:P(25,7)nmatch:P(15,2)pmatch:P(1,5)=*(26,5)eflags:P(0,1)rc:r(0,1)options:r(0,1)ovector:r(25,6)small_ovector:(1,6)=ar(13,3);0;29;(0,1)allocated_ovector:r(2,1)i:r(15,2)estring:S(1,7)=ar(13,3);0;43;(1,8)=k(25,7)eint:S(1,9)=ar(13,3);0;43;(1,10)=k(0,1)pstring:S(1,11)=ar(13,3);0;17;(1,8) LLP"o %B  =BT  GB  l  QxxW ` `a_ d irDD<<<@  |9  &\ &'070701000067de000041ed0000000a0000000a00000004402cbe2400000000000000880000000500000000000000000000000aff350889reloc/man07070100007655000041ed0000000a0000000a00000002402cbe2400000000000000880000000500000000000000000000000fff350889reloc/man/man107070100007656000081a40000000a0000000a00000001402cbcbd00000fda000000880000000500000000000000000000001aff35088ereloc/man/man1/pcregrep.1.TH PCREGREP 1 .SH NAME pcregrep - a grep with Perl-compatible regular expressions. .SH SYNOPSIS .B pcregrep [-Vcfhilnrsuvx] [long options] [pattern] [file1 file2 ...] .SH DESCRIPTION .rs .sp \fBpcregrep\fR searches files for character patterns, in the same way as other grep commands do, but it uses the PCRE regular expression library to support patterns that are compatible with the regular expressions of Perl 5. See .\" HREF \fBpcrepattern\fR .\" for a full description of syntax and semantics of the regular expressions that PCRE supports. A pattern must be specified on the command line unless the \fB-f\fR option is used (see below). If no files are specified, \fBpcregrep\fR reads the standard input. By default, each line that matches the pattern is copied to the standard output, and if there is more than one file, the file name is printed before each line of output. However, there are options that can change how \fBpcregrep\fR behaves. Lines are limited to BUFSIZ characters. BUFSIZ is defined in \fB\fR. The newline character is removed from the end of each line before it is matched against the pattern. .SH OPTIONS .rs .sp .TP 10 \fB-V\fR Write the version number of the PCRE library being used to the standard error stream. .TP \fB-c\fR Do not print individual lines; instead just print a count of the number of lines that would otherwise have been printed. If several files are given, a count is printed for each of them. .TP \fB-f\fR\fIfilename\fR Read a number of patterns from the file, one per line, and match all of them against each line of input. A line is output if any of the patterns match it. When \fB-f\fR is used, no pattern is taken from the command line; all arguments are treated as file names. There is a maximum of 100 patterns. Trailing white space is removed, and blank lines are ignored. An empty file contains no patterns and therefore matches nothing. .TP \fB-h\fR Suppress printing of filenames when searching multiple files. .TP \fB-i\fR Ignore upper/lower case distinctions during comparisons. .TP \fB-l\fR Instead of printing lines from the files, just print the names of the files containing lines that would have been printed. Each file name is printed once, on a separate line. .TP \fB-n\fR Precede each line by its line number in the file. .TP \fB-r\fR If any file is a directory, recursively scan the files it contains. Without \fB-r\fR a directory is scanned as a normal file. .TP \fB-s\fR Work silently, that is, display nothing except error messages. The exit status indicates whether any matches were found. .TP \fB-u\fR Operate in UTF-8 mode. This option is available only if PCRE has been compiled with UTF-8 support. Both the pattern and each subject line are assumed to be valid strings of UTF-8 characters. .TP \fB-v\fR Invert the sense of the match, so that lines which do \fInot\fR match the pattern are now the ones that are found. .TP \fB-x\fR Force the pattern to be anchored (it must start matching at the beginning of the line) and in addition, require it to match the entire line. This is equivalent to having ^ and $ characters at the start and end of each alternative branch in the regular expression. .SH LONG OPTIONS .rs .sp Long forms of all the options are available, as in GNU grep. They are shown in the following table: -c --count -h --no-filename -i --ignore-case -l --files-with-matches -n --line-number -r --recursive -s --no-messages -u --utf-8 -V --version -v --invert-match -x --line-regex -x --line-regexp In addition, --file=\fIfilename\fR is equivalent to -f\fIfilename\fR, and --help shows the list of options and then exits. .SH DIAGNOSTICS .rs .sp Exit status is 0 if any matches were found, 1 if no matches were found, and 2 for syntax errors or inacessible files (even if matches were found). .SH AUTHOR .rs .sp Philip Hazel .br University Computing Service .br Cambridge CB2 3QG, England. .in 0 Last updated: 03 February 2003 .br Copyright (c) 1997-2003 University of Cambridge. 07070100007657000081a40000000a0000000a00000001402cbcbd00003b17000000880000000500000000000000000000001aff35088ereloc/man/man1/pcretest.1.TH PCRETEST 1 .SH NAME pcretest - a program for testing Perl-compatible regular expressions. .SH SYNOPSIS .B pcretest "[-d] [-i] [-m] [-o osize] [-p] [-t] [source] [destination]" \fBpcretest\fR was written as a test program for the PCRE regular expression library itself, but it can also be used for experimenting with regular expressions. This document describes the features of the test program; for details of the regular expressions themselves, see the .\" HREF \fBpcrepattern\fR .\" documentation. For details of PCRE and its options, see the .\" HREF \fBpcreapi\fR .\" documentation. .SH OPTIONS .rs .sp .TP 10 \fB-C\fR Output the version number of the PCRE library, and all available information about the optional features that are included, and then exit. .TP 10 \fB-d\fR Behave as if each regex had the \fB/D\fR modifier (see below); the internal form is output after compilation. .TP 10 \fB-i\fR Behave as if each regex had the \fB/I\fR modifier; information about the compiled pattern is given after compilation. .TP 10 \fB-m\fR Output the size of each compiled pattern after it has been compiled. This is equivalent to adding /M to each regular expression. For compatibility with earlier versions of pcretest, \fB-s\fR is a synonym for \fB-m\fR. .TP 10 \fB-o\fR \fIosize\fR Set the number of elements in the output vector that is used when calling PCRE to be \fIosize\fR. The default value is 45, which is enough for 14 capturing subexpressions. The vector size can be changed for individual matching calls by including \\O in the data line (see below). .TP 10 \fB-p\fR Behave as if each regex has \fB/P\fR modifier; the POSIX wrapper API is used to call PCRE. None of the other options has any effect when \fB-p\fR is set. .TP 10 \fB-t\fR Run each compile, study, and match many times with a timer, and output resulting time per compile or match (in milliseconds). Do not set \fB-t\fR with \fB-m\fR, because you will then get the size output 20000 times and the timing will be distorted. .SH DESCRIPTION .rs .sp If \fBpcretest\fR is given two filename arguments, it reads from the first and writes to the second. If it is given only one filename argument, it reads from that file and writes to stdout. Otherwise, it reads from stdin and writes to stdout, and prompts for each line of input, using "re>" to prompt for regular expressions, and "data>" to prompt for data lines. The program handles any number of sets of input on a single input file. Each set starts with a regular expression, and continues with any number of data lines to be matched against the pattern. Each line is matched separately and independently. If you want to do multiple-line matches, you have to use the \\n escape sequence in a single line of input to encode the newline characters. The maximum length of data line is 30,000 characters. An empty line signals the end of the data lines, at which point a new regular expression is read. The regular expressions are given enclosed in any non-alphameric delimiters other than backslash, for example /(a|bc)x+yz/ White space before the initial delimiter is ignored. A regular expression may be continued over several input lines, in which case the newline characters are included within it. It is possible to include the delimiter within the pattern by escaping it, for example /abc\\/def/ If you do so, the escape and the delimiter form part of the pattern, but since delimiters are always non-alphameric, this does not affect its interpretation. If the terminating delimiter is immediately followed by a backslash, for example, /abc/\\ then a backslash is added to the end of the pattern. This is done to provide a way of testing the error condition that arises if a pattern finishes with a backslash, because /abc\\/ is interpreted as the first line of a pattern that starts with "abc/", causing pcretest to read the next line as a continuation of the regular expression. .SH PATTERN MODIFIERS .rs .sp The pattern may be followed by \fBi\fR, \fBm\fR, \fBs\fR, or \fBx\fR to set the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, or PCRE_EXTENDED options, respectively. For example: /caseless/i These modifier letters have the same effect as they do in Perl. There are others that set PCRE options that do not correspond to anything in Perl: \fB/A\fR, \fB/E\fR, \fB/N\fR, \fB/U\fR, and \fB/X\fR set PCRE_ANCHORED, PCRE_DOLLAR_ENDONLY, PCRE_NO_AUTO_CAPTURE, PCRE_UNGREEDY, and PCRE_EXTRA respectively. Searching for all possible matches within each subject string can be requested by the \fB/g\fR or \fB/G\fR modifier. After finding a match, PCRE is called again to search the remainder of the subject string. The difference between \fB/g\fR and \fB/G\fR is that the former uses the \fIstartoffset\fR argument to \fBpcre_exec()\fR to start searching at a new point within the entire string (which is in effect what Perl does), whereas the latter passes over a shortened substring. This makes a difference to the matching process if the pattern begins with a lookbehind assertion (including \\b or \\B). If any call to \fBpcre_exec()\fR in a \fB/g\fR or \fB/G\fR sequence matches an empty string, the next call is done with the PCRE_NOTEMPTY and PCRE_ANCHORED flags set in order to search for another, non-empty, match at the same point. If this second match fails, the start offset is advanced by one, and the normal match is retried. This imitates the way Perl handles such cases when using the \fB/g\fR modifier or the \fBsplit()\fR function. There are a number of other modifiers for controlling the way \fBpcretest\fR operates. The \fB/+\fR modifier requests that as well as outputting the substring that matched the entire pattern, pcretest should in addition output the remainder of the subject string. This is useful for tests where the subject contains multiple copies of the same substring. The \fB/L\fR modifier must be followed directly by the name of a locale, for example, /pattern/Lfr For this reason, it must be the last modifier letter. The given locale is set, \fBpcre_maketables()\fR is called to build a set of character tables for the locale, and this is then passed to \fBpcre_compile()\fR when compiling the regular expression. Without an \fB/L\fR modifier, NULL is passed as the tables pointer; that is, \fB/L\fR applies only to the expression on which it appears. The \fB/I\fR modifier requests that \fBpcretest\fR output information about the compiled expression (whether it is anchored, has a fixed first character, and so on). It does this by calling \fBpcre_fullinfo()\fR after compiling an expression, and outputting the information it gets back. If the pattern is studied, the results of that are also output. The \fB/D\fR modifier is a PCRE debugging feature, which also assumes \fB/I\fR. It causes the internal form of compiled regular expressions to be output after compilation. If the pattern was studied, the information returned is also output. The \fB/S\fR modifier causes \fBpcre_study()\fR to be called after the expression has been compiled, and the results used when the expression is matched. The \fB/M\fR modifier causes the size of memory block used to hold the compiled pattern to be output. The \fB/P\fR modifier causes \fBpcretest\fR to call PCRE via the POSIX wrapper API rather than its native API. When this is done, all other modifiers except \fB/i\fR, \fB/m\fR, and \fB/+\fR are ignored. REG_ICASE is set if \fB/i\fR is present, and REG_NEWLINE is set if \fB/m\fR is present. The wrapper functions force PCRE_DOLLAR_ENDONLY always, and PCRE_DOTALL unless REG_NEWLINE is set. The \fB/8\fR modifier causes \fBpcretest\fR to call PCRE with the PCRE_UTF8 option set. This turns on support for UTF-8 character handling in PCRE, provided that it was compiled with this support enabled. This modifier also causes any non-printing characters in output strings to be printed using the \\x{hh...} notation if they are valid UTF-8 sequences. If the \fB/?\fR modifier is used with \fB/8\fR, it causes \fBpcretest\fR to call \fBpcre_compile()\fR with the PCRE_NO_UTF8_CHECK option, to suppress the checking of the string for UTF-8 validity. .SH CALLOUTS .rs .sp If the pattern contains any callout requests, \fBpcretest\fR's callout function will be called. By default, it displays the callout number, and the start and current positions in the text at the callout time. For example, the output --->pqrabcdef 0 ^ ^ indicates that callout number 0 occurred for a match attempt starting at the fourth character of the subject string, when the pointer was at the seventh character. The callout function returns zero (carry on matching) by default. Inserting callouts may be helpful when using \fBpcretest\fR to check complicated regular expressions. For further information about callouts, see the .\" HREF \fBpcrecallout\fR .\" documentation. For testing the PCRE library, additional control of callout behaviour is available via escape sequences in the data, as described in the following section. In particular, it is possible to pass in a number as callout data (the default is zero). If the callout function receives a non-zero number, it returns that value instead of zero. .SH DATA LINES .rs .sp Before each data line is passed to \fBpcre_exec()\fR, leading and trailing whitespace is removed, and it is then scanned for \\ escapes. Some of these are pretty esoteric features, intended for checking out some of the more complicated features of PCRE. If you are just testing "ordinary" regular expressions, you probably don't need any of these. The following escapes are recognized: \\a alarm (= BEL) \\b backspace \\e escape \\f formfeed \\n newline \\r carriage return \\t tab \\v vertical tab \\nnn octal character (up to 3 octal digits) \\xhh hexadecimal character (up to 2 hex digits) \\x{hh...} hexadecimal character, any number of digits in UTF-8 mode \\A pass the PCRE_ANCHORED option to \fBpcre_exec()\fR \\B pass the PCRE_NOTBOL option to \fBpcre_exec()\fR \\Cdd call pcre_copy_substring() for substring dd after a successful match (any decimal number less than 32) \\Cname call pcre_copy_named_substring() for substring "name" after a successful match (name termin- ated by next non alphanumeric character) \\C+ show the current captured substrings at callout time \\C- do not supply a callout function \\C!n return 1 instead of 0 when callout number n is reached \\C!n!m return 1 instead of 0 when callout number n is reached for the nth time \\C*n pass the number n (may be negative) as callout data \\Gdd call pcre_get_substring() for substring dd after a successful match (any decimal number less than 32) \\Gname call pcre_get_named_substring() for substring "name" after a successful match (name termin- ated by next non-alphanumeric character) \\L call pcre_get_substringlist() after a successful match \\M discover the minimum MATCH_LIMIT setting \\N pass the PCRE_NOTEMPTY option to \fBpcre_exec()\fR \\Odd set the size of the output vector passed to \fBpcre_exec()\fR to dd (any number of decimal digits) \\S output details of memory get/free calls during matching \\Z pass the PCRE_NOTEOL option to \fBpcre_exec()\fR \\? pass the PCRE_NO_UTF8_CHECK option to \fBpcre_exec()\fR If \\M is present, \fBpcretest\fR calls \fBpcre_exec()\fR several times, with different values in the \fImatch_limit\fR field of the \fBpcre_extra\fR data structure, until it finds the minimum number that is needed for \fBpcre_exec()\fR to complete. This number is a measure of the amount of recursion and backtracking that takes place, and checking it out can be instructive. For most simple matches, the number is quite small, but for patterns with very large numbers of matching possibilities, it can become large very quickly with increasing length of subject string. When \\O is used, it may be higher or lower than the size set by the \fB-O\fR option (or defaulted to 45); \\O applies only to the call of \fBpcre_exec()\fR for the line in which it appears. A backslash followed by anything else just escapes the anything else. If the very last character is a backslash, it is ignored. This gives a way of passing an empty line as data, since a real empty line terminates the data input. If \fB/P\fR was present on the regex, causing the POSIX wrapper API to be used, only \fB\B\fR, and \fB\Z\fR have any effect, causing REG_NOTBOL and REG_NOTEOL to be passed to \fBregexec()\fR respectively. The use of \\x{hh...} to represent UTF-8 characters is not dependent on the use of the \fB/8\fR modifier on the pattern. It is recognized always. There may be any number of hexadecimal digits inside the braces. The result is from one to six bytes, encoded according to the UTF-8 rules. .SH OUTPUT FROM PCRETEST .rs .sp When a match succeeds, pcretest outputs the list of captured substrings that \fBpcre_exec()\fR returns, starting with number 0 for the string that matched the whole pattern. Here is an example of an interactive pcretest run. $ pcretest PCRE version 4.00 08-Jan-2003 re> /^abc(\\d+)/ data> abc123 0: abc123 1: 123 data> xyz No match If the strings contain any non-printing characters, they are output as \\0x escapes, or as \\x{...} escapes if the \fB/8\fR modifier was present on the pattern. If the pattern has the \fB/+\fR modifier, then the output for substring 0 is followed by the the rest of the subject string, identified by "0+" like this: re> /cat/+ data> cataract 0: cat 0+ aract If the pattern has the \fB/g\fR or \fB/G\fR modifier, the results of successive matching attempts are output in sequence, like this: re> /\\Bi(\\w\\w)/g data> Mississippi 0: iss 1: ss 0: iss 1: ss 0: ipp 1: pp "No match" is output only if the first match attempt fails. If any of the sequences \fB\\C\fR, \fB\\G\fR, or \fB\\L\fR are present in a data line that is successfully matched, the substrings extracted by the convenience functions are output with C, G, or L after the string number instead of a colon. This is in addition to the normal full list. The string length (that is, the return from the extraction function) is given in parentheses after each string for \fB\\C\fR and \fB\\G\fR. Note that while patterns can be continued over several lines (a plain ">" prompt is used for continuations), data lines may not. However newlines can be included in data by means of the \\n escape. .SH AUTHOR .rs .sp Philip Hazel .br University Computing Service, .br Cambridge CB2 3QG, England. .in 0 Last updated: 09 December 2003 .br Copyright (c) 1997-2003 University of Cambridge. 0707010000940a000041ed0000000a0000000a00000002402cbe2400000000000000880000000500000000000000000000000fff35088ereloc/man/man30707010000940b000081a40000000a0000000a00000001402cbcbd00001b0c0000008800000005000000000000000000000016ff35088ereloc/man/man3/pcre.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH DESCRIPTION .rs .sp The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl, with just a few differences. The current implementation of PCRE (release 4.x) corresponds approximately with Perl 5.8, including support for UTF-8 encoded strings. However, this support has to be explicitly enabled; it is not the default. PCRE is written in C and released as a C library. However, a number of people have written wrappers and interfaces of various kinds. A C++ class is included in these contributions, which can be found in the \fIContrib\fR directory at the primary FTP site, which is: .\" HTML .\" ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre Details of exactly which Perl regular expression features are and are not supported by PCRE are given in separate documents. See the .\" HREF \fBpcrepattern\fR .\" and .\" HREF \fBpcrecompat\fR .\" pages. Some features of PCRE can be included, excluded, or changed when the library is built. The .\" HREF \fBpcre_config()\fR .\" function makes it possible for a client to discover which features are available. Documentation about building PCRE for various operating systems can be found in the \fBREADME\fR file in the source distribution. .SH USER DOCUMENTATION .rs .sp The user documentation for PCRE has been split up into a number of different sections. In the "man" format, each of these is a separate "man page". In the HTML format, each is a separate page, linked from the index page. In the plain text format, all the sections are concatenated, for ease of searching. The sections are as follows: pcre this document pcreapi details of PCRE's native API pcrebuild options for building PCRE pcrecallout details of the callout feature pcrecompat discussion of Perl compatibility pcregrep description of the \fBpcregrep\fR command pcrepattern syntax and semantics of supported regular expressions pcreperform discussion of performance issues pcreposix the POSIX-compatible API pcresample discussion of the sample program pcretest the \fBpcretest\fR testing command In addition, in the "man" and HTML formats, there is a short page for each library function, listing its arguments and results. .SH LIMITATIONS .rs .sp There are some size limitations in PCRE but it is hoped that they will never in practice be relevant. The maximum length of a compiled pattern is 65539 (sic) bytes if PCRE is compiled with the default internal linkage size of 2. If you want to process regular expressions that are truly enormous, you can compile PCRE with an internal linkage size of 3 or 4 (see the \fBREADME\fR file in the source distribution and the .\" HREF \fBpcrebuild\fR .\" documentation for details). If these cases the limit is substantially larger. However, the speed of execution will be slower. All values in repeating quantifiers must be less than 65536. The maximum number of capturing subpatterns is 65535. There is no limit to the number of non-capturing subpatterns, but the maximum depth of nesting of all kinds of parenthesized subpattern, including capturing subpatterns, assertions, and other types of subpattern, is 200. The maximum length of a subject string is the largest positive number that an integer variable can hold. However, PCRE uses recursion to handle subpatterns and indefinite repetition. This means that the available stack space may limit the size of a subject string that can be processed by certain patterns. .\" HTML .SH UTF-8 SUPPORT .rs .sp Starting at release 3.3, PCRE has had some support for character strings encoded in the UTF-8 format. For release 4.0 this has been greatly extended to cover most common requirements. In order process UTF-8 strings, you must build PCRE to include UTF-8 support in the code, and, in addition, you must call .\" HREF \fBpcre_compile()\fR .\" with the PCRE_UTF8 option flag. When you do this, both the pattern and any subject strings that are matched against it are treated as UTF-8 strings instead of just strings of bytes. If you compile PCRE with UTF-8 support, but do not use it at run time, the library will be a bit bigger, but the additional run time overhead is limited to testing the PCRE_UTF8 flag in several places, so should not be very large. The following comments apply when PCRE is running in UTF-8 mode: 1. When you set the PCRE_UTF8 flag, the strings passed as patterns and subjects are checked for validity on entry to the relevant functions. If an invalid UTF-8 string is passed, an error return is given. In some situations, you may already know that your strings are valid, and therefore want to skip these checks in order to improve performance. If you set the PCRE_NO_UTF8_CHECK flag at compile time or at run time, PCRE assumes that the pattern or subject it is given (respectively) contains only valid UTF-8 codes. In this case, it does not diagnose an invalid UTF-8 string. If you pass an invalid UTF-8 string to PCRE when PCRE_NO_UTF8_CHECK is set, the results are undefined. Your program may crash. 2. In a pattern, the escape sequence \\x{...}, where the contents of the braces is a string of hexadecimal digits, is interpreted as a UTF-8 character whose code number is the given hexadecimal number, for example: \\x{1234}. If a non-hexadecimal digit appears between the braces, the item is not recognized. This escape sequence can be used either as a literal, or within a character class. 3. The original hexadecimal escape sequence, \\xhh, matches a two-byte UTF-8 character if the value is greater than 127. 4. Repeat quantifiers apply to complete UTF-8 characters, not to individual bytes, for example: \\x{100}{3}. 5. The dot metacharacter matches one UTF-8 character instead of a single byte. 6. The escape sequence \\C can be used to match a single byte in UTF-8 mode, but its use can lead to some strange effects. 7. The character escapes \\b, \\B, \\d, \\D, \\s, \\S, \\w, and \\W correctly test characters of any code value, but the characters that PCRE recognizes as digits, spaces, or word characters remain the same set as before, all with values less than 256. 8. Case-insensitive matching applies only to characters whose values are less than 256. PCRE does not support the notion of "case" for higher-valued characters. 9. PCRE does not support the use of Unicode tables and properties or the Perl escapes \\p, \\P, and \\X. .SH AUTHOR .rs .sp Philip Hazel .br University Computing Service, .br Cambridge CB2 3QG, England. .br Phone: +44 1223 334714 .in 0 Last updated: 20 August 2003 .br Copyright (c) 1997-2003 University of Cambridge. 0707010000940c000081a40000000a0000000a00000001402cbcbd00000778000000880000000500000000000000000000001eff35088ereloc/man/man3/pcre_compile.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B pcre *pcre_compile(const char *\fIpattern\fR, int \fIoptions\fR, .ti +5n .B const char **\fIerrptr\fR, int *\fIerroffset\fR, .ti +5n .B const unsigned char *\fItableptr\fR); .SH DESCRIPTION .rs .sp This function compiles a regular expression into an internal form. Its arguments are: \fIpattern\fR A zero-terminated string containing the regular expression to be compiled \fIoptions\fR Zero or more option bits \fIerrptr\fR Where to put an error message \fIerroffset\fR Offset in pattern where error was found \fItableptr\fR Pointer to character tables, or NULL to use the built-in default The option bits are: PCRE_ANCHORED Force pattern anchoring PCRE_CASELESS Do caseless matching PCRE_DOLLAR_ENDONLY $ not to match newline at end PCRE_DOTALL . matches anything including NL PCRE_EXTENDED Ignore whitespace and # comments PCRE_EXTRA PCRE extra features (not much use currently) PCRE_MULTILINE ^ and $ match newlines within data PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren- theses (named ones available) PCRE_UNGREEDY Invert greediness of quantifiers PCRE_UTF8 Run in UTF-8 mode PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8 validity (only relevant if PCRE_UTF8 is set) PCRE must be compiled with UTF-8 support in order to use PCRE_UTF8 (or PCRE_NO_UTF8_CHECK). The yield of the function is a pointer to a private data structure that contains the compiled pattern, or NULL if an error was detected. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 0707010000940d000081a40000000a0000000a00000001402cbcbd000004fc000000880000000500000000000000000000001dff35088ereloc/man/man3/pcre_config.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_config(int \fIwhat\fR, void *\fIwhere\fR); .SH DESCRIPTION .rs .sp This function makes it possible for a client program to find out which optional features are available in the version of the PCRE library it is using. Its arguments are as follows: \fIwhat\fR A code specifying what information is required \fIwhere\fR Points to where to put the data The available codes are: PCRE_CONFIG_LINK_SIZE Internal link size: 2, 3, or 4 PCRE_CONFIG_MATCH_LIMIT Internal resource limit PCRE_CONFIG_NEWLINE Value of the newline character PCRE_CONFIG_POSIX_MALLOC_THRESHOLD Threshold of return slots, above which \fBmalloc()\fR is used by the POSIX API PCRE_CONFIG_STACKRECURSE Recursion implementation (1=stack 0=heap) PCRE_CONFIG_UTF8 Availability of UTF-8 support (1=yes 0=no) The function yields 0 on success or PCRE_ERROR_BADOPTION otherwise. There is a complete description of the PCRE native API in the .\" HREF \fBpcreapi\fR .\" page, and a description of the POSIX API in the .\" HREF \fBpcreposix\fR .\" page. 0707010000940e000081a40000000a0000000a00000001402cbcbd0000046a000000880000000500000000000000000000002bff35088ereloc/man/man3/pcre_copy_named_substring.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_copy_named_substring(const pcre *\fIcode\fR, .ti +5n .B const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, const char *\fIstringname\fR, .ti +5n .B char *\fIbuffer\fR, int \fIbuffersize\fR); .SH DESCRIPTION .rs .sp This is a convenience function for extracting a captured substring, identified by name, into a given buffer. The arguments are: \fIcode\fR Pattern that was successfully matched \fIsubject\fR Subject that has been successfully matched \fIovector\fR Offset vector that \fBpcre_exec()\fR used \fIstringcount\fR Value returned by \fBpcre_exec()\fR \fIstringname\fR Name of the required substring \fIbuffer\fR Buffer to receive the string \fIbuffersize\fR Size of buffer The yield is the length of the substring, PCRE_ERROR_NOMEMORY if the buffer was too small, or PCRE_ERROR_NOSUBSTRING if the string name is invalid. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 0707010000940f000081a40000000a0000000a00000001402cbcbd000003eb0000008800000005000000000000000000000025ff35088ereloc/man/man3/pcre_copy_substring.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_copy_substring(const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, int \fIstringnumber\fR, char *\fIbuffer\fR, .ti +5n .B int \fIbuffersize\fR); .SH DESCRIPTION .rs .sp This is a convenience function for extracting a captured substring into a given buffer. The arguments are: \fIsubject\fR Subject that has been successfully matched \fIovector\fR Offset vector that \fBpcre_exec()\fR used \fIstringcount\fR Value returned by \fBpcre_exec()\fR \fIstringnumber\fR Number of the required substring \fIbuffer\fR Buffer to receive the string \fIbuffersize\fR Size of buffer The yield is the legnth of the string, PCRE_ERROR_NOMEMORY if the buffer was too small, or PCRE_ERROR_NOSUBSTRING if the string number is invalid. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100009410000081a40000000a0000000a00000001402cbcbd00000600000000880000000500000000000000000000001bff35088ereloc/man/man3/pcre_exec.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_exec(const pcre *\fIcode\fR, "const pcre_extra *\fIextra\fR," .ti +5n .B "const char *\fIsubject\fR," int \fIlength\fR, int \fIstartoffset\fR, .ti +5n .B int \fIoptions\fR, int *\fIovector\fR, int \fIovecsize\fR); .SH DESCRIPTION .rs .sp This function matches a compiled regular expression against a given subject string, and returns offsets to capturing subexpressions. Its arguments are: \fIcode\fR Points to the compiled pattern \fIextra\fR Points to an associated \fBpcre_extra\fR structure, or is NULL \fIsubject\fR Points to the subject string \fIlength\fR Length of the subject string, in bytes \fIstartoffset\fR Offset in bytes in the subject at which to start matching \fIoptions\fR Option bits \fIovector\fR Points to a vector of ints for result offsets \fIovecsize\fR Size of the vector (a multiple of 3) The options are: PCRE_ANCHORED Match only at the first position PCRE_NOTBOL Subject is not the beginning of a line PCRE_NOTEOL Subject is not the end of a line PCRE_NOTEMPTY An empty string is not a valid match PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8 validity (only relevant if PCRE_UTF8 was set at compile time) There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100009411000081a40000000a0000000a00000001402cbcbd000001e30000008800000005000000000000000000000025ff35088ereloc/man/man3/pcre_free_substring.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B void pcre_free_substring(const char *\fIstringptr\fR); .SH DESCRIPTION .rs .sp This is a convenience function for freeing the store obtained by a previous call to \fBpcre_get_substring()\fR or \fBpcre_get_named_substring()\fR. Its only argument is a pointer to the string. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100009412000081a40000000a0000000a00000001402cbcbd000001db000000880000000500000000000000000000002aff35088ereloc/man/man3/pcre_free_substring_list.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B void pcre_free_substring_list(const char **\fIstringptr\fR); .SH DESCRIPTION .rs .sp This is a convenience function for freeing the store obtained by a previous call to \fBpcre_get_substring_list()\fR. Its only argument is a pointer to the list of string pointers. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100009413000081a40000000a0000000a00000001402cbcbd00000696000000880000000500000000000000000000001fff35088ereloc/man/man3/pcre_fullinfo.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_fullinfo(const pcre *\fIcode\fR, "const pcre_extra *\fIextra\fR," .ti +5n .B int \fIwhat\fR, void *\fIwhere\fR); .SH DESCRIPTION .rs .sp This function returns information about a compiled pattern. Its arguments are: \fIcode\fR Compiled regular expression \fIextra\fR Result of \fBpcre_study()\fR or NULL \fIwhat\fR What information is required \fIwhere\fR Where to put the information The following information is available: PCRE_INFO_BACKREFMAX Number of highest back reference PCRE_INFO_CAPTURECOUNT Number of capturing subpatterns PCRE_INFO_FIRSTBYTE Fixed first byte for a match, or -1 for start of string or after newline, or -2 otherwise PCRE_INFO_FIRSTTABLE Table of first bytes (after studying) PCRE_INFO_LASTLITERAL Literal last byte required PCRE_INFO_NAMECOUNT Number of named subpatterns PCRE_INFO_NAMEENTRYSIZE Size of name table entry PCRE_INFO_NAMETABLE Pointer to name table PCRE_INFO_OPTIONS Options used for compilation PCRE_INFO_SIZE Size of compiled pattern The yield of the function is zero on success or: PCRE_ERROR_NULL the argument \fIcode\fR was NULL the argument \fIwhere\fR was NULL PCRE_ERROR_BADMAGIC the "magic number" was not found PCRE_ERROR_BADOPTION the value of \fIwhat\fR was invalid There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100009414000081a40000000a0000000a00000001402cbcbd0000041e000000880000000500000000000000000000002aff35088ereloc/man/man3/pcre_get_named_substring.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_get_named_substring(const pcre *\fIcode\fR, .ti +5n .B const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, const char *\fIstringname\fR, .ti +5n .B const char **\fIstringptr\fR); .SH DESCRIPTION .rs .sp This is a convenience function for extracting a captured substring by name. The arguments are: \fIcode\fR Compiled pattern \fIsubject\fR Subject that has been successfully matched \fIovector\fR Offset vector that \fBpcre_exec()\fR used \fIstringcount\fR Value returned by \fBpcre_exec()\fR \fIstringname\fR Name of the required substring \fIstringptr\fR Where to put the string pointer The yield is the length of the extracted substring, PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or PCRE_ERROR_NOSUBSTRING if the string name is invalid. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100009415000081a40000000a0000000a00000001402cbcbd000002920000008800000005000000000000000000000027ff35088ereloc/man/man3/pcre_get_stringnumber.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_get_stringnumber(const pcre *\fIcode\fR, .ti +5n .B const char *\fIname\fR); .SH DESCRIPTION .rs .sp This convenience function finds the number of a named substring capturing parenthesis in a compiled pattern. Its arguments are: \fIcode\fR Compiled regular expression \fIname\fR Name whose number is required The yield of the function is the number of the parenthesis if the name is found, or PCRE_ERROR_NOSUBSTRING otherwise. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100009416000081a40000000a0000000a00000001402cbcbd000003ba0000008800000005000000000000000000000024ff35088ereloc/man/man3/pcre_get_substring.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_get_substring(const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, int \fIstringnumber\fR, .ti +5n .B const char **\fIstringptr\fR); .SH DESCRIPTION .rs .sp This is a convenience function for extracting a captured substring. The arguments are: \fIsubject\fR Subject that has been successfully matched \fIovector\fR Offset vector that \fBpcre_exec()\fR used \fIstringcount\fR Value returned by \fBpcre_exec()\fR \fIstringnumber\fR Number of the required substring \fIstringptr\fR Where to put the string pointer The yield is the length of the substring, PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained, or PCRE_ERROR_NOSUBSTRING if the string number is invalid. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100009417000081a40000000a0000000a00000001402cbcbd000003310000008800000005000000000000000000000029ff35088ereloc/man/man3/pcre_get_substring_list.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_get_substring_list(const char *\fIsubject\fR, .ti +5n .B int *\fIovector\fR, int \fIstringcount\fR, "const char ***\fIlistptr\fR);" .SH DESCRIPTION .rs .sp This is a convenience function for extracting a list of all the captured substrings. The arguments are: \fIsubject\fR Subject that has been successfully matched \fIovector\fR Offset vector that \fBpcre_exec\fR used \fIstringcount\fR Value returned by \fBpcre_exec\fR \fIlistptr\fR Where to put a pointer to the list The yield is zero on success or PCRE_ERROR_NOMEMORY if sufficient memory could not be obtained. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100009418000081a40000000a0000000a00000001402cbcbd0000018e000000880000000500000000000000000000001bff35088ereloc/man/man3/pcre_info.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B int pcre_info(const pcre *\fIcode\fR, int *\fIoptptr\fR, int .B *\fIfirstcharptr\fR); .SH DESCRIPTION .rs .sp This function is obsolete. You should be using \fBpcre_fullinfo()\fR instead. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 07070100009419000081a40000000a0000000a00000001402cbcbd000002520000008800000005000000000000000000000021ff35088ereloc/man/man3/pcre_maketables.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B const unsigned char *pcre_maketables(void); .SH DESCRIPTION .rs .sp This function builds a set of character tables which can be passed to \fBpcre_compile()\fR to override PCRE's internal, built-in tables (which were made by \fBpcre_maketables()\fR when PCRE was compiled). You might want to do this if you are using a non-standard locale. The function yields a pointer to the tables. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 0707010000941a000081a40000000a0000000a00000001402cbcbd00000396000000880000000500000000000000000000001cff35088ereloc/man/man3/pcre_study.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B pcre_extra *pcre_study(const pcre *\fIcode\fR, int \fIoptions\fR, .ti +5n .B const char **\fIerrptr\fR); .SH DESCRIPTION .rs .sp This function studies a compiled pattern, to see if additional information can be extracted that might speed up matching. Its arguments are: \fIcode\fR A compiled regular expression \fIoptions\fR Options for \fBpcre_study()\fR \fIerrptr\fR Where to put an error message If the function returns NULL, either it could not find any additional information, or there was an error. You can tell the difference by looking at the error value. It is NULL in first case. There are currently no options defined; the value of the second argument should always be zero. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 0707010000941b000081a40000000a0000000a00000001402cbcbd00000179000000880000000500000000000000000000001eff35088ereloc/man/man3/pcre_version.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS .rs .sp .B #include .PP .SM .br .B char *pcre_version(void); .SH DESCRIPTION .rs .sp This function returns a character string that gives the version number of the PCRE library, and its date of release. There is a complete description of the PCRE API in the .\" HREF \fBpcreapi\fR .\" page. 0707010000941c000081a40000000a0000000a00000001402cbcbd0000b83a0000008800000005000000000000000000000019ff35088ereloc/man/man3/pcreapi.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH SYNOPSIS OF PCRE API .rs .sp .B #include .PP .SM .br .B pcre *pcre_compile(const char *\fIpattern\fR, int \fIoptions\fR, .ti +5n .B const char **\fIerrptr\fR, int *\fIerroffset\fR, .ti +5n .B const unsigned char *\fItableptr\fR); .PP .br .B pcre_extra *pcre_study(const pcre *\fIcode\fR, int \fIoptions\fR, .ti +5n .B const char **\fIerrptr\fR); .PP .br .B int pcre_exec(const pcre *\fIcode\fR, "const pcre_extra *\fIextra\fR," .ti +5n .B "const char *\fIsubject\fR," int \fIlength\fR, int \fIstartoffset\fR, .ti +5n .B int \fIoptions\fR, int *\fIovector\fR, int \fIovecsize\fR); .PP .br .B int pcre_copy_named_substring(const pcre *\fIcode\fR, .ti +5n .B const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, const char *\fIstringname\fR, .ti +5n .B char *\fIbuffer\fR, int \fIbuffersize\fR); .PP .br .B int pcre_copy_substring(const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, int \fIstringnumber\fR, char *\fIbuffer\fR, .ti +5n .B int \fIbuffersize\fR); .PP .br .B int pcre_get_named_substring(const pcre *\fIcode\fR, .ti +5n .B const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, const char *\fIstringname\fR, .ti +5n .B const char **\fIstringptr\fR); .PP .br .B int pcre_get_stringnumber(const pcre *\fIcode\fR, .ti +5n .B const char *\fIname\fR); .PP .br .B int pcre_get_substring(const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, int \fIstringnumber\fR, .ti +5n .B const char **\fIstringptr\fR); .PP .br .B int pcre_get_substring_list(const char *\fIsubject\fR, .ti +5n .B int *\fIovector\fR, int \fIstringcount\fR, "const char ***\fIlistptr\fR);" .PP .br .B void pcre_free_substring(const char *\fIstringptr\fR); .PP .br .B void pcre_free_substring_list(const char **\fIstringptr\fR); .PP .br .B const unsigned char *pcre_maketables(void); .PP .br .B int pcre_fullinfo(const pcre *\fIcode\fR, "const pcre_extra *\fIextra\fR," .ti +5n .B int \fIwhat\fR, void *\fIwhere\fR); .PP .br .B int pcre_info(const pcre *\fIcode\fR, int *\fIoptptr\fR, int .B *\fIfirstcharptr\fR); .PP .br .B int pcre_config(int \fIwhat\fR, void *\fIwhere\fR); .PP .br .B char *pcre_version(void); .PP .br .B void *(*pcre_malloc)(size_t); .PP .br .B void (*pcre_free)(void *); .PP .br .B void *(*pcre_stack_malloc)(size_t); .PP .br .B void (*pcre_stack_free)(void *); .PP .br .B int (*pcre_callout)(pcre_callout_block *); .SH PCRE API .rs .sp PCRE has its own native API, which is described in this document. There is also a set of wrapper functions that correspond to the POSIX regular expression API. These are described in the \fBpcreposix\fR documentation. The native API function prototypes are defined in the header file \fBpcre.h\fR, and on Unix systems the library itself is called \fBlibpcre.a\fR, so can be accessed by adding \fB-lpcre\fR to the command for linking an application which calls it. The header file defines the macros PCRE_MAJOR and PCRE_MINOR to contain the major and minor release numbers for the library. Applications can use these to include support for different releases. The functions \fBpcre_compile()\fR, \fBpcre_study()\fR, and \fBpcre_exec()\fR are used for compiling and matching regular expressions. A sample program that demonstrates the simplest way of using them is given in the file \fIpcredemo.c\fR. The \fBpcresample\fR documentation describes how to run it. There are convenience functions for extracting captured substrings from a matched subject string. They are: \fBpcre_copy_substring()\fR \fBpcre_copy_named_substring()\fR \fBpcre_get_substring()\fR \fBpcre_get_named_substring()\fR \fBpcre_get_substring_list()\fR \fBpcre_free_substring()\fR and \fBpcre_free_substring_list()\fR are also provided, to free the memory used for extracted strings. The function \fBpcre_maketables()\fR is used (optionally) to build a set of character tables in the current locale for passing to \fBpcre_compile()\fR. The function \fBpcre_fullinfo()\fR is used to find out information about a compiled pattern; \fBpcre_info()\fR is an obsolete version which returns only some of the available information, but is retained for backwards compatibility. The function \fBpcre_version()\fR returns a pointer to a string containing the version of PCRE and its date of release. The global variables \fBpcre_malloc\fR and \fBpcre_free\fR initially contain the entry points of the standard \fBmalloc()\fR and \fBfree()\fR functions respectively. PCRE calls the memory management functions via these variables, so a calling program can replace them if it wishes to intercept the calls. This should be done before calling any PCRE functions. The global variables \fBpcre_stack_malloc\fR and \fBpcre_stack_free\fR are also indirections to memory management functions. These special functions are used only when PCRE is compiled to use the heap for remembering data, instead of recursive function calls. This is a non-standard way of building PCRE, for use in environments that have limited stacks. Because of the greater use of memory management, it runs more slowly. Separate functions are provided so that special-purpose external code can be used for this case. When used, these functions are always called in a stack-like manner (last obtained, first freed), and always for memory blocks of the same size. The global variable \fBpcre_callout\fR initially contains NULL. It can be set by the caller to a "callout" function, which PCRE will then call at specified points during a matching operation. Details are given in the \fBpcrecallout\fR documentation. .SH MULTITHREADING .rs .sp The PCRE functions can be used in multi-threading applications, with the proviso that the memory management functions pointed to by \fBpcre_malloc\fR, \fBpcre_free\fR, \fBpcre_stack_malloc\fR, and \fBpcre_stack_free\fR, and the callout function pointed to by \fBpcre_callout\fR, are shared by all threads. The compiled form of a regular expression is not altered during matching, so the same compiled pattern can safely be used by several threads at once. .SH CHECKING BUILD-TIME OPTIONS .rs .sp .B int pcre_config(int \fIwhat\fR, void *\fIwhere\fR); .PP The function \fBpcre_config()\fR makes it possible for a PCRE client to discover which optional features have been compiled into the PCRE library. The .\" HREF \fBpcrebuild\fR .\" documentation has more details about these optional features. The first argument for \fBpcre_config()\fR is an integer, specifying which information is required; the second argument is a pointer to a variable into which the information is placed. The following information is available: PCRE_CONFIG_UTF8 The output is an integer that is set to one if UTF-8 support is available; otherwise it is set to zero. PCRE_CONFIG_NEWLINE The output is an integer that is set to the value of the code that is used for the newline character. It is either linefeed (10) or carriage return (13), and should normally be the standard character for your operating system. PCRE_CONFIG_LINK_SIZE The output is an integer that contains the number of bytes used for internal linkage in compiled regular expressions. The value is 2, 3, or 4. Larger values allow larger regular expressions to be compiled, at the expense of slower matching. The default value of 2 is sufficient for all but the most massive patterns, since it allows the compiled pattern to be up to 64K in size. PCRE_CONFIG_POSIX_MALLOC_THRESHOLD The output is an integer that contains the threshold above which the POSIX interface uses \fBmalloc()\fR for output vectors. Further details are given in the \fBpcreposix\fR documentation. PCRE_CONFIG_MATCH_LIMIT The output is an integer that gives the default limit for the number of internal matching function calls in a \fBpcre_exec()\fR execution. Further details are given with \fBpcre_exec()\fR below. PCRE_CONFIG_STACKRECURSE The output is an integer that is set to one if internal recursion is implemented by recursive function calls that use the stack to remember their state. This is the usual way that PCRE is compiled. The output is zero if PCRE was compiled to use blocks of data on the heap instead of recursive function calls. In this case, \fBpcre_stack_malloc\fR and \fBpcre_stack_free\fR are called to manage memory blocks on the heap, thus avoiding the use of the stack. .SH COMPILING A PATTERN .rs .sp .B pcre *pcre_compile(const char *\fIpattern\fR, int \fIoptions\fR, .ti +5n .B const char **\fIerrptr\fR, int *\fIerroffset\fR, .ti +5n .B const unsigned char *\fItableptr\fR); .PP The function \fBpcre_compile()\fR is called to compile a pattern into an internal form. The pattern is a C string terminated by a binary zero, and is passed in the argument \fIpattern\fR. A pointer to a single block of memory that is obtained via \fBpcre_malloc\fR is returned. This contains the compiled code and related data. The \fBpcre\fR type is defined for the returned block; this is a typedef for a structure whose contents are not externally defined. It is up to the caller to free the memory when it is no longer required. Although the compiled code of a PCRE regex is relocatable, that is, it does not depend on memory location, the complete \fBpcre\fR data block is not fully relocatable, because it contains a copy of the \fItableptr\fR argument, which is an address (see below). The \fIoptions\fR argument contains independent bits that affect the compilation. It should be zero if no options are required. Some of the options, in particular, those that are compatible with Perl, can also be set and unset from within the pattern (see the detailed description of regular expressions in the \fBpcrepattern\fR documentation). For these options, the contents of the \fIoptions\fR argument specifies their initial settings at the start of compilation and execution. The PCRE_ANCHORED option can be set at the time of matching as well as at compile time. If \fIerrptr\fR is NULL, \fBpcre_compile()\fR returns NULL immediately. Otherwise, if compilation of a pattern fails, \fBpcre_compile()\fR returns NULL, and sets the variable pointed to by \fIerrptr\fR to point to a textual error message. The offset from the start of the pattern to the character where the error was discovered is placed in the variable pointed to by \fIerroffset\fR, which must not be NULL. If it is, an immediate error is given. If the final argument, \fItableptr\fR, is NULL, PCRE uses a default set of character tables which are built when it is compiled, using the default C locale. Otherwise, \fItableptr\fR must be the result of a call to \fBpcre_maketables()\fR. See the section on locale support below. This code fragment shows a typical straightforward call to \fBpcre_compile()\fR: pcre *re; const char *error; int erroffset; re = pcre_compile( "^A.*Z", /* the pattern */ 0, /* default options */ &error, /* for error message */ &erroffset, /* for error offset */ NULL); /* use default character tables */ The following option bits are defined: PCRE_ANCHORED If this bit is set, the pattern is forced to be "anchored", that is, it is constrained to match only at the first matching point in the string which is being searched (the "subject string"). This effect can also be achieved by appropriate constructs in the pattern itself, which is the only way to do it in Perl. PCRE_CASELESS If this bit is set, letters in the pattern match both upper and lower case letters. It is equivalent to Perl's /i option, and it can be changed within a pattern by a (?i) option setting. PCRE_DOLLAR_ENDONLY If this bit is set, a dollar metacharacter in the pattern matches only at the end of the subject string. Without this option, a dollar also matches immediately before the final character if it is a newline (but not before any other newlines). The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is set. There is no equivalent to this option in Perl, and no way to set it within a pattern. PCRE_DOTALL If this bit is set, a dot metacharater in the pattern matches all characters, including newlines. Without it, newlines are excluded. This option is equivalent to Perl's /s option, and it can be changed within a pattern by a (?s) option setting. A negative class such as [^a] always matches a newline character, independent of the setting of this option. PCRE_EXTENDED If this bit is set, whitespace data characters in the pattern are totally ignored except when escaped or inside a character class. Whitespace does not include the VT character (code 11). In addition, characters between an unescaped # outside a character class and the next newline character, inclusive, are also ignored. This is equivalent to Perl's /x option, and it can be changed within a pattern by a (?x) option setting. This option makes it possible to include comments inside complicated patterns. Note, however, that this applies only to data characters. Whitespace characters may never appear within special character sequences in a pattern, for example within the sequence (?( which introduces a conditional subpattern. PCRE_EXTRA This option was invented in order to turn on additional functionality of PCRE that is incompatible with Perl, but it is currently of very little use. When set, any backslash in a pattern that is followed by a letter that has no special meaning causes an error, thus reserving these combinations for future expansion. By default, as in Perl, a backslash followed by a letter with no special meaning is treated as a literal. There are at present no other features controlled by this option. It can also be set by a (?X) option setting within a pattern. PCRE_MULTILINE By default, PCRE treats the subject string as consisting of a single "line" of characters (even if it actually contains several newlines). The "start of line" metacharacter (^) matches only at the start of the string, while the "end of line" metacharacter ($) matches only at the end of the string, or before a terminating newline (unless PCRE_DOLLAR_ENDONLY is set). This is the same as Perl. When PCRE_MULTILINE it is set, the "start of line" and "end of line" constructs match immediately following or immediately before any newline in the subject string, respectively, as well as at the very start and end. This is equivalent to Perl's /m option, and it can be changed within a pattern by a (?m) option setting. If there are no "\\n" characters in a subject string, or no occurrences of ^ or $ in a pattern, setting PCRE_MULTILINE has no effect. PCRE_NO_AUTO_CAPTURE If this option is set, it disables the use of numbered capturing parentheses in the pattern. Any opening parenthesis that is not followed by ? behaves as if it were followed by ?: but named parentheses can still be used for capturing (and they acquire numbers in the usual way). There is no equivalent of this option in Perl. PCRE_UNGREEDY This option inverts the "greediness" of the quantifiers so that they are not greedy by default, but become greedy if followed by "?". It is not compatible with Perl. It can also be set by a (?U) option setting within the pattern. PCRE_UTF8 This option causes PCRE to regard both the pattern and the subject as strings of UTF-8 characters instead of single-byte character strings. However, it is available only if PCRE has been built to include UTF-8 support. If not, the use of this option provokes an error. Details of how this option changes the behaviour of PCRE are given in the .\" HTML .\" section on UTF-8 support .\" in the main .\" HREF \fBpcre\fR .\" page. PCRE_NO_UTF8_CHECK When PCRE_UTF8 is set, the validity of the pattern as a UTF-8 string is automatically checked. If an invalid UTF-8 sequence of bytes is found, \fBpcre_compile()\fR returns an error. If you already know that your pattern is valid, and you want to skip this check for performance reasons, you can set the PCRE_NO_UTF8_CHECK option. When it is set, the effect of passing an invalid UTF-8 string as a pattern is undefined. It may cause your program to crash. Note that there is a similar option for suppressing the checking of subject strings passed to \fBpcre_exec()\fR. .SH STUDYING A PATTERN .rs .sp .B pcre_extra *pcre_study(const pcre *\fIcode\fR, int \fIoptions\fR, .ti +5n .B const char **\fIerrptr\fR); .PP When a pattern is going to be used several times, it is worth spending more time analyzing it in order to speed up the time taken for matching. The function \fBpcre_study()\fR takes a pointer to a compiled pattern as its first argument. If studing the pattern produces additional information that will help speed up matching, \fBpcre_study()\fR returns a pointer to a \fBpcre_extra\fR block, in which the \fIstudy_data\fR field points to the results of the study. The returned value from a \fBpcre_study()\fR can be passed directly to \fBpcre_exec()\fR. However, the \fBpcre_extra\fR block also contains other fields that can be set by the caller before the block is passed; these are described below. If studying the pattern does not produce any additional information, \fBpcre_study()\fR returns NULL. In that circumstance, if the calling program wants to pass some of the other fields to \fBpcre_exec()\fR, it must set up its own \fBpcre_extra\fR block. The second argument contains option bits. At present, no options are defined for \fBpcre_study()\fR, and this argument should always be zero. The third argument for \fBpcre_study()\fR is a pointer for an error message. If studying succeeds (even if no data is returned), the variable it points to is set to NULL. Otherwise it points to a textual error message. You should therefore test the error pointer for NULL after calling \fBpcre_study()\fR, to be sure that it has run successfully. This is a typical call to \fBpcre_study\fR(): pcre_extra *pe; pe = pcre_study( re, /* result of pcre_compile() */ 0, /* no options exist */ &error); /* set to NULL or points to a message */ At present, studying a pattern is useful only for non-anchored patterns that do not have a single fixed starting character. A bitmap of possible starting characters is created. .\" HTML .SH LOCALE SUPPORT .rs .sp PCRE handles caseless matching, and determines whether characters are letters, digits, or whatever, by reference to a set of tables. When running in UTF-8 mode, this applies only to characters with codes less than 256. The library contains a default set of tables that is created in the default C locale when PCRE is compiled. This is used when the final argument of \fBpcre_compile()\fR is NULL, and is sufficient for many applications. An alternative set of tables can, however, be supplied. Such tables are built by calling the \fBpcre_maketables()\fR function, which has no arguments, in the relevant locale. The result can then be passed to \fBpcre_compile()\fR as often as necessary. For example, to build and use tables that are appropriate for the French locale (where accented characters with codes greater than 128 are treated as letters), the following code could be used: setlocale(LC_CTYPE, "fr"); tables = pcre_maketables(); re = pcre_compile(..., tables); The tables are built in memory that is obtained via \fBpcre_malloc\fR. The pointer that is passed to \fBpcre_compile\fR is saved with the compiled pattern, and the same tables are used via this pointer by \fBpcre_study()\fR and \fBpcre_exec()\fR. Thus, for any single pattern, compilation, studying and matching all happen in the same locale, but different patterns can be compiled in different locales. It is the caller's responsibility to ensure that the memory containing the tables remains available for as long as it is needed. .SH INFORMATION ABOUT A PATTERN .rs .sp .B int pcre_fullinfo(const pcre *\fIcode\fR, "const pcre_extra *\fIextra\fR," .ti +5n .B int \fIwhat\fR, void *\fIwhere\fR); .PP The \fBpcre_fullinfo()\fR function returns information about a compiled pattern. It replaces the obsolete \fBpcre_info()\fR function, which is nevertheless retained for backwards compability (and is documented below). The first argument for \fBpcre_fullinfo()\fR is a pointer to the compiled pattern. The second argument is the result of \fBpcre_study()\fR, or NULL if the pattern was not studied. The third argument specifies which piece of information is required, and the fourth argument is a pointer to a variable to receive the data. The yield of the function is zero for success, or one of the following negative numbers: PCRE_ERROR_NULL the argument \fIcode\fR was NULL the argument \fIwhere\fR was NULL PCRE_ERROR_BADMAGIC the "magic number" was not found PCRE_ERROR_BADOPTION the value of \fIwhat\fR was invalid Here is a typical call of \fBpcre_fullinfo()\fR, to obtain the length of the compiled pattern: int rc; unsigned long int length; rc = pcre_fullinfo( re, /* result of pcre_compile() */ pe, /* result of pcre_study(), or NULL */ PCRE_INFO_SIZE, /* what is required */ &length); /* where to put the data */ The possible values for the third argument are defined in \fBpcre.h\fR, and are as follows: PCRE_INFO_BACKREFMAX Return the number of the highest back reference in the pattern. The fourth argument should point to an \fBint\fR variable. Zero is returned if there are no back references. PCRE_INFO_CAPTURECOUNT Return the number of capturing subpatterns in the pattern. The fourth argument should point to an \fbint\fR variable. PCRE_INFO_FIRSTBYTE Return information about the first byte of any matched string, for a non-anchored pattern. (This option used to be called PCRE_INFO_FIRSTCHAR; the old name is still recognized for backwards compatibility.) If there is a fixed first byte, e.g. from a pattern such as (cat|cow|coyote), it is returned in the integer pointed to by \fIwhere\fR. Otherwise, if either (a) the pattern was compiled with the PCRE_MULTILINE option, and every branch starts with "^", or (b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set (if it were set, the pattern would be anchored), -1 is returned, indicating that the pattern matches only at the start of a subject string or after any newline within the string. Otherwise -2 is returned. For anchored patterns, -2 is returned. PCRE_INFO_FIRSTTABLE If the pattern was studied, and this resulted in the construction of a 256-bit table indicating a fixed set of bytes for the first byte in any matching string, a pointer to the table is returned. Otherwise NULL is returned. The fourth argument should point to an \fBunsigned char *\fR variable. PCRE_INFO_LASTLITERAL Return the value of the rightmost literal byte that must exist in any matched string, other than at its start, if such a byte has been recorded. The fourth argument should point to an \fBint\fR variable. If there is no such byte, -1 is returned. For anchored patterns, a last literal byte is recorded only if it follows something of variable length. For example, for the pattern /^a\\d+z\\d+/ the returned value is "z", but for /^a\\dz\\d/ the returned value is -1. PCRE_INFO_NAMECOUNT PCRE_INFO_NAMEENTRYSIZE PCRE_INFO_NAMETABLE PCRE supports the use of named as well as numbered capturing parentheses. The names are just an additional way of identifying the parentheses, which still acquire a number. A caller that wants to extract data from a named subpattern must convert the name to a number in order to access the correct pointers in the output vector (described with \fBpcre_exec()\fR below). In order to do this, it must first use these three values to obtain the name-to-number mapping table for the pattern. The map consists of a number of fixed-size entries. PCRE_INFO_NAMECOUNT gives the number of entries, and PCRE_INFO_NAMEENTRYSIZE gives the size of each entry; both of these return an \fBint\fR value. The entry size depends on the length of the longest name. PCRE_INFO_NAMETABLE returns a pointer to the first entry of the table (a pointer to \fBchar\fR). The first two bytes of each entry are the number of the capturing parenthesis, most significant byte first. The rest of the entry is the corresponding name, zero terminated. The names are in alphabetical order. For example, consider the following pattern (assume PCRE_EXTENDED is set, so white space - including newlines - is ignored): (?P (?P(\\d\\d)?\\d\\d) - (?P\\d\\d) - (?P\\d\\d) ) There are four named subpatterns, so the table has four entries, and each entry in the table is eight bytes long. The table is as follows, with non-printing bytes shows in hex, and undefined bytes shown as ??: 00 01 d a t e 00 ?? 00 05 d a y 00 ?? ?? 00 04 m o n t h 00 00 02 y e a r 00 ?? When writing code to extract data from named subpatterns, remember that the length of each entry may be different for each compiled pattern. PCRE_INFO_OPTIONS Return a copy of the options with which the pattern was compiled. The fourth argument should point to an \fBunsigned long int\fR variable. These option bits are those specified in the call to \fBpcre_compile()\fR, modified by any top-level option settings within the pattern itself. A pattern is automatically anchored by PCRE if all of its top-level alternatives begin with one of the following: ^ unless PCRE_MULTILINE is set \\A always \\G always .* if PCRE_DOTALL is set and there are no back references to the subpattern in which .* appears For such patterns, the PCRE_ANCHORED bit is set in the options returned by \fBpcre_fullinfo()\fR. PCRE_INFO_SIZE Return the size of the compiled pattern, that is, the value that was passed as the argument to \fBpcre_malloc()\fR when PCRE was getting memory in which to place the compiled data. The fourth argument should point to a \fBsize_t\fR variable. PCRE_INFO_STUDYSIZE Returns the size of the data block pointed to by the \fIstudy_data\fR field in a \fBpcre_extra\fR block. That is, it is the value that was passed to \fBpcre_malloc()\fR when PCRE was getting memory into which to place the data created by \fBpcre_study()\fR. The fourth argument should point to a \fBsize_t\fR variable. .SH OBSOLETE INFO FUNCTION .rs .sp .B int pcre_info(const pcre *\fIcode\fR, int *\fIoptptr\fR, int .B *\fIfirstcharptr\fR); .PP The \fBpcre_info()\fR function is now obsolete because its interface is too restrictive to return all the available data about a compiled pattern. New programs should use \fBpcre_fullinfo()\fR instead. The yield of \fBpcre_info()\fR is the number of capturing subpatterns, or one of the following negative numbers: PCRE_ERROR_NULL the argument \fIcode\fR was NULL PCRE_ERROR_BADMAGIC the "magic number" was not found If the \fIoptptr\fR argument is not NULL, a copy of the options with which the pattern was compiled is placed in the integer it points to (see PCRE_INFO_OPTIONS above). If the pattern is not anchored and the \fIfirstcharptr\fR argument is not NULL, it is used to pass back information about the first character of any matched string (see PCRE_INFO_FIRSTBYTE above). .SH MATCHING A PATTERN .rs .sp .B int pcre_exec(const pcre *\fIcode\fR, "const pcre_extra *\fIextra\fR," .ti +5n .B "const char *\fIsubject\fR," int \fIlength\fR, int \fIstartoffset\fR, .ti +5n .B int \fIoptions\fR, int *\fIovector\fR, int \fIovecsize\fR); .PP The function \fBpcre_exec()\fR is called to match a subject string against a pre-compiled pattern, which is passed in the \fIcode\fR argument. If the pattern has been studied, the result of the study should be passed in the \fIextra\fR argument. Here is an example of a simple call to \fBpcre_exec()\fR: int rc; int ovector[30]; rc = pcre_exec( re, /* result of pcre_compile() */ NULL, /* we didn't study the pattern */ "some string", /* the subject string */ 11, /* the length of the subject string */ 0, /* start at offset 0 in the subject */ 0, /* default options */ ovector, /* vector for substring information */ 30); /* number of elements in the vector */ If the \fIextra\fR argument is not NULL, it must point to a \fBpcre_extra\fR data block. The \fBpcre_study()\fR function returns such a block (when it doesn't return NULL), but you can also create one for yourself, and pass additional information in it. The fields in the block are as follows: unsigned long int \fIflags\fR; void *\fIstudy_data\fR; unsigned long int \fImatch_limit\fR; void *\fIcallout_data\fR; The \fIflags\fR field is a bitmap that specifies which of the other fields are set. The flag bits are: PCRE_EXTRA_STUDY_DATA PCRE_EXTRA_MATCH_LIMIT PCRE_EXTRA_CALLOUT_DATA Other flag bits should be set to zero. The \fIstudy_data\fR field is set in the \fBpcre_extra\fR block that is returned by \fBpcre_study()\fR, together with the appropriate flag bit. You should not set this yourself, but you can add to the block by setting the other fields. The \fImatch_limit\fR field provides a means of preventing PCRE from using up a vast amount of resources when running patterns that are not going to match, but which have a very large number of possibilities in their search trees. The classic example is the use of nested unlimited repeats. Internally, PCRE uses a function called \fBmatch()\fR which it calls repeatedly (sometimes recursively). The limit is imposed on the number of times this function is called during a match, which has the effect of limiting the amount of recursion and backtracking that can take place. For patterns that are not anchored, the count starts from zero for each position in the subject string. The default limit for the library can be set when PCRE is built; the default default is 10 million, which handles all but the most extreme cases. You can reduce the default by suppling \fBpcre_exec()\fR with a \fRpcre_extra\fR block in which \fImatch_limit\fR is set to a smaller value, and PCRE_EXTRA_MATCH_LIMIT is set in the \fIflags\fR field. If the limit is exceeded, \fBpcre_exec()\fR returns PCRE_ERROR_MATCHLIMIT. The \fIpcre_callout\fR field is used in conjunction with the "callout" feature, which is described in the \fBpcrecallout\fR documentation. The PCRE_ANCHORED option can be passed in the \fIoptions\fR argument, whose unused bits must be zero. This limits \fBpcre_exec()\fR to matching at the first matching position. However, if a pattern was compiled with PCRE_ANCHORED, or turned out to be anchored by virtue of its contents, it cannot be made unachored at matching time. When PCRE_UTF8 was set at compile time, the validity of the subject as a UTF-8 string is automatically checked, and the value of \fIstartoffset\fR is also checked to ensure that it points to the start of a UTF-8 character. If an invalid UTF-8 sequence of bytes is found, \fBpcre_exec()\fR returns the error PCRE_ERROR_BADUTF8. If \fIstartoffset\fR contains an invalid value, PCRE_ERROR_BADUTF8_OFFSET is returned. If you already know that your subject is valid, and you want to skip these checks for performance reasons, you can set the PCRE_NO_UTF8_CHECK option when calling \fBpcre_exec()\fR. You might want to do this for the second and subsequent calls to \fBpcre_exec()\fR if you are making repeated calls to find all the matches in a single subject string. However, you should be sure that the value of \fIstartoffset\fR points to the start of a UTF-8 character. When PCRE_NO_UTF8_CHECK is set, the effect of passing an invalid UTF-8 string as a subject, or a value of \fIstartoffset\fR that does not point to the start of a UTF-8 character, is undefined. Your program may crash. There are also three further options that can be set only at matching time: PCRE_NOTBOL The first character of the string is not the beginning of a line, so the circumflex metacharacter should not match before it. Setting this without PCRE_MULTILINE (at compile time) causes circumflex never to match. PCRE_NOTEOL The end of the string is not the end of a line, so the dollar metacharacter should not match it nor (except in multiline mode) a newline immediately before it. Setting this without PCRE_MULTILINE (at compile time) causes dollar never to match. PCRE_NOTEMPTY An empty string is not considered to be a valid match if this option is set. If there are alternatives in the pattern, they are tried. If all the alternatives match the empty string, the entire match fails. For example, if the pattern a?b? is applied to a string not beginning with "a" or "b", it matches the empty string at the start of the subject. With PCRE_NOTEMPTY set, this match is not valid, so PCRE searches further into the string for occurrences of "a" or "b". Perl has no direct equivalent of PCRE_NOTEMPTY, but it does make a special case of a pattern match of the empty string within its \fBsplit()\fR function, and when using the /g modifier. It is possible to emulate Perl's behaviour after matching a null string by first trying the match again at the same offset with PCRE_NOTEMPTY set, and then if that fails by advancing the starting offset (see below) and trying an ordinary match again. The subject string is passed to \fBpcre_exec()\fR as a pointer in \fIsubject\fR, a length in \fIlength\fR, and a starting byte offset in \fIstartoffset\fR. Unlike the pattern string, the subject may contain binary zero bytes. When the starting offset is zero, the search for a match starts at the beginning of the subject, and this is by far the most common case. If the pattern was compiled with the PCRE_UTF8 option, the subject must be a sequence of bytes that is a valid UTF-8 string, and the starting offset must point to the beginning of a UTF-8 character. If an invalid UTF-8 string or offset is passed, an error (either PCRE_ERROR_BADUTF8 or PCRE_ERROR_BADUTF8_OFFSET) is returned, unless the option PCRE_NO_UTF8_CHECK is set, in which case PCRE's behaviour is not defined. A non-zero starting offset is useful when searching for another match in the same subject by calling \fBpcre_exec()\fR again after a previous success. Setting \fIstartoffset\fR differs from just passing over a shortened string and setting PCRE_NOTBOL in the case of a pattern that begins with any kind of lookbehind. For example, consider the pattern \\Biss\\B which finds occurrences of "iss" in the middle of words. (\\B matches only if the current position in the subject is not a word boundary.) When applied to the string "Mississipi" the first call to \fBpcre_exec()\fR finds the first occurrence. If \fBpcre_exec()\fR is called again with just the remainder of the subject, namely "issipi", it does not match, because \\B is always false at the start of the subject, which is deemed to be a word boundary. However, if \fBpcre_exec()\fR is passed the entire string again, but with \fIstartoffset\fR set to 4, it finds the second occurrence of "iss" because it is able to look behind the starting point to discover that it is preceded by a letter. If a non-zero starting offset is passed when the pattern is anchored, one attempt to match at the given offset is tried. This can only succeed if the pattern does not require the match to be at the start of the subject. In general, a pattern matches a certain portion of the subject, and in addition, further substrings from the subject may be picked out by parts of the pattern. Following the usage in Jeffrey Friedl's book, this is called "capturing" in what follows, and the phrase "capturing subpattern" is used for a fragment of a pattern that picks out a substring. PCRE supports several other kinds of parenthesized subpattern that do not cause substrings to be captured. Captured substrings are returned to the caller via a vector of integer offsets whose address is passed in \fIovector\fR. The number of elements in the vector is passed in \fIovecsize\fR. The first two-thirds of the vector is used to pass back captured substrings, each substring using a pair of integers. The remaining third of the vector is used as workspace by \fBpcre_exec()\fR while matching capturing subpatterns, and is not available for passing back information. The length passed in \fIovecsize\fR should always be a multiple of three. If it is not, it is rounded down. When a match has been successful, information about captured substrings is returned in pairs of integers, starting at the beginning of \fIovector\fR, and continuing up to two-thirds of its length at the most. The first element of a pair is set to the offset of the first character in a substring, and the second is set to the offset of the first character after the end of a substring. The first pair, \fIovector[0]\fR and \fIovector[1]\fR, identify the portion of the subject string matched by the entire pattern. The next pair is used for the first capturing subpattern, and so on. The value returned by \fBpcre_exec()\fR is the number of pairs that have been set. If there are no capturing subpatterns, the return value from a successful match is 1, indicating that just the first pair of offsets has been set. Some convenience functions are provided for extracting the captured substrings as separate strings. These are described in the following section. It is possible for an capturing subpattern number \fIn+1\fR to match some part of the subject when subpattern \fIn\fR has not been used at all. For example, if the string "abc" is matched against the pattern (a|(z))(bc) subpatterns 1 and 3 are matched, but 2 is not. When this happens, both offset values corresponding to the unused subpattern are set to -1. If a capturing subpattern is matched repeatedly, it is the last portion of the string that it matched that gets returned. If the vector is too small to hold all the captured substrings, it is used as far as possible (up to two-thirds of its length), and the function returns a value of zero. In particular, if the substring offsets are not of interest, \fBpcre_exec()\fR may be called with \fIovector\fR passed as NULL and \fIovecsize\fR as zero. However, if the pattern contains back references and the \fIovector\fR isn't big enough to remember the related substrings, PCRE has to get additional memory for use during matching. Thus it is usually advisable to supply an \fIovector\fR. Note that \fBpcre_info()\fR can be used to find out how many capturing subpatterns there are in a compiled pattern. The smallest size for \fIovector\fR that will allow for \fIn\fR captured substrings, in addition to the offsets of the substring matched by the whole pattern, is (\fIn\fR+1)*3. If \fBpcre_exec()\fR fails, it returns a negative number. The following are defined in the header file: PCRE_ERROR_NOMATCH (-1) The subject string did not match the pattern. PCRE_ERROR_NULL (-2) Either \fIcode\fR or \fIsubject\fR was passed as NULL, or \fIovector\fR was NULL and \fIovecsize\fR was not zero. PCRE_ERROR_BADOPTION (-3) An unrecognized bit was set in the \fIoptions\fR argument. PCRE_ERROR_BADMAGIC (-4) PCRE stores a 4-byte "magic number" at the start of the compiled code, to catch the case when it is passed a junk pointer. This is the error it gives when the magic number isn't present. PCRE_ERROR_UNKNOWN_NODE (-5) While running the pattern match, an unknown item was encountered in the compiled pattern. This error could be caused by a bug in PCRE or by overwriting of the compiled pattern. PCRE_ERROR_NOMEMORY (-6) If a pattern contains back references, but the \fIovector\fR that is passed to \fBpcre_exec()\fR is not big enough to remember the referenced substrings, PCRE gets a block of memory at the start of matching to use for this purpose. If the call via \fBpcre_malloc()\fR fails, this error is given. The memory is freed at the end of matching. PCRE_ERROR_NOSUBSTRING (-7) This error is used by the \fBpcre_copy_substring()\fR, \fBpcre_get_substring()\fR, and \fBpcre_get_substring_list()\fR functions (see below). It is never returned by \fBpcre_exec()\fR. PCRE_ERROR_MATCHLIMIT (-8) The recursion and backtracking limit, as specified by the \fImatch_limit\fR field in a \fBpcre_extra\fR structure (or defaulted) was reached. See the description above. PCRE_ERROR_CALLOUT (-9) This error is never generated by \fBpcre_exec()\fR itself. It is provided for use by callout functions that want to yield a distinctive error code. See the \fBpcrecallout\fR documentation for details. PCRE_ERROR_BADUTF8 (-10) A string that contains an invalid UTF-8 byte sequence was passed as a subject. PCRE_ERROR_BADUTF8_OFFSET (-11) The UTF-8 byte sequence that was passed as a subject was valid, but the value of \fIstartoffset\fR did not point to the beginning of a UTF-8 character. .SH EXTRACTING CAPTURED SUBSTRINGS BY NUMBER .rs .sp .B int pcre_copy_substring(const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, int \fIstringnumber\fR, char *\fIbuffer\fR, .ti +5n .B int \fIbuffersize\fR); .PP .br .B int pcre_get_substring(const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, int \fIstringnumber\fR, .ti +5n .B const char **\fIstringptr\fR); .PP .br .B int pcre_get_substring_list(const char *\fIsubject\fR, .ti +5n .B int *\fIovector\fR, int \fIstringcount\fR, "const char ***\fIlistptr\fR);" .PP Captured substrings can be accessed directly by using the offsets returned by \fBpcre_exec()\fR in \fIovector\fR. For convenience, the functions \fBpcre_copy_substring()\fR, \fBpcre_get_substring()\fR, and \fBpcre_get_substring_list()\fR are provided for extracting captured substrings as new, separate, zero-terminated strings. These functions identify substrings by number. The next section describes functions for extracting named substrings. A substring that contains a binary zero is correctly extracted and has a further zero added on the end, but the result is not, of course, a C string. The first three arguments are the same for all three of these functions: \fIsubject\fR is the subject string which has just been successfully matched, \fIovector\fR is a pointer to the vector of integer offsets that was passed to \fBpcre_exec()\fR, and \fIstringcount\fR is the number of substrings that were captured by the match, including the substring that matched the entire regular expression. This is the value returned by \fBpcre_exec\fR if it is greater than zero. If \fBpcre_exec()\fR returned zero, indicating that it ran out of space in \fIovector\fR, the value passed as \fIstringcount\fR should be the size of the vector divided by three. The functions \fBpcre_copy_substring()\fR and \fBpcre_get_substring()\fR extract a single substring, whose number is given as \fIstringnumber\fR. A value of zero extracts the substring that matched the entire pattern, while higher values extract the captured substrings. For \fBpcre_copy_substring()\fR, the string is placed in \fIbuffer\fR, whose length is given by \fIbuffersize\fR, while for \fBpcre_get_substring()\fR a new block of memory is obtained via \fBpcre_malloc\fR, and its address is returned via \fIstringptr\fR. The yield of the function is the length of the string, not including the terminating zero, or one of PCRE_ERROR_NOMEMORY (-6) The buffer was too small for \fBpcre_copy_substring()\fR, or the attempt to get memory failed for \fBpcre_get_substring()\fR. PCRE_ERROR_NOSUBSTRING (-7) There is no substring whose number is \fIstringnumber\fR. The \fBpcre_get_substring_list()\fR function extracts all available substrings and builds a list of pointers to them. All this is done in a single block of memory which is obtained via \fBpcre_malloc\fR. The address of the memory block is returned via \fIlistptr\fR, which is also the start of the list of string pointers. The end of the list is marked by a NULL pointer. The yield of the function is zero if all went well, or PCRE_ERROR_NOMEMORY (-6) if the attempt to get the memory block failed. When any of these functions encounter a substring that is unset, which can happen when capturing subpattern number \fIn+1\fR matches some part of the subject, but subpattern \fIn\fR has not been used at all, they return an empty string. This can be distinguished from a genuine zero-length substring by inspecting the appropriate offset in \fIovector\fR, which is negative for unset substrings. The two convenience functions \fBpcre_free_substring()\fR and \fBpcre_free_substring_list()\fR can be used to free the memory returned by a previous call of \fBpcre_get_substring()\fR or \fBpcre_get_substring_list()\fR, respectively. They do nothing more than call the function pointed to by \fBpcre_free\fR, which of course could be called directly from a C program. However, PCRE is used in some situations where it is linked via a special interface to another programming language which cannot use \fBpcre_free\fR directly; it is for these cases that the functions are provided. .SH EXTRACTING CAPTURED SUBSTRINGS BY NAME .rs .sp .B int pcre_copy_named_substring(const pcre *\fIcode\fR, .ti +5n .B const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, const char *\fIstringname\fR, .ti +5n .B char *\fIbuffer\fR, int \fIbuffersize\fR); .PP .br .B int pcre_get_stringnumber(const pcre *\fIcode\fR, .ti +5n .B const char *\fIname\fR); .PP .br .B int pcre_get_named_substring(const pcre *\fIcode\fR, .ti +5n .B const char *\fIsubject\fR, int *\fIovector\fR, .ti +5n .B int \fIstringcount\fR, const char *\fIstringname\fR, .ti +5n .B const char **\fIstringptr\fR); .PP To extract a substring by name, you first have to find associated number. This can be done by calling \fBpcre_get_stringnumber()\fR. The first argument is the compiled pattern, and the second is the name. For example, for this pattern ab(?\\d+)... the number of the subpattern called "xxx" is 1. Given the number, you can then extract the substring directly, or use one of the functions described in the previous section. For convenience, there are also two functions that do the whole job. Most of the arguments of \fIpcre_copy_named_substring()\fR and \fIpcre_get_named_substring()\fR are the same as those for the functions that extract by number, and so are not re-described here. There are just two differences. First, instead of a substring number, a substring name is given. Second, there is an extra argument, given at the start, which is a pointer to the compiled pattern. This is needed in order to gain access to the name-to-number translation table. These functions call \fBpcre_get_stringnumber()\fR, and if it succeeds, they then call \fIpcre_copy_substring()\fR or \fIpcre_get_substring()\fR, as appropriate. .in 0 Last updated: 09 December 2003 .br Copyright (c) 1997-2003 University of Cambridge. 0707010000941d000081a40000000a0000000a00000001402cbcbd00001603000000880000000500000000000000000000001bff35088ereloc/man/man3/pcrebuild.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH PCRE BUILD-TIME OPTIONS .rs .sp This document describes the optional features of PCRE that can be selected when the library is compiled. They are all selected, or deselected, by providing options to the \fBconfigure\fR script which is run before the \fBmake\fR command. The complete list of options for \fBconfigure\fR (which includes the standard ones such as the selection of the installation directory) can be obtained by running ./configure --help The following sections describe certain options whose names begin with --enable or --disable. These settings specify changes to the defaults for the \fBconfigure\fR command. Because of the way that \fBconfigure\fR works, --enable and --disable always come in pairs, so the complementary option always exists as well, but as it specifies the default, it is not described. .SH UTF-8 SUPPORT .rs .sp To build PCRE with support for UTF-8 character strings, add --enable-utf8 to the \fBconfigure\fR command. Of itself, this does not make PCRE treat strings as UTF-8. As well as compiling PCRE with this option, you also have have to set the PCRE_UTF8 option when you call the \fBpcre_compile()\fR function. .SH CODE VALUE OF NEWLINE .rs .sp By default, PCRE treats character 10 (linefeed) as the newline character. This is the normal newline character on Unix-like systems. You can compile PCRE to use character 13 (carriage return) instead by adding --enable-newline-is-cr to the \fBconfigure\fR command. For completeness there is also a --enable-newline-is-lf option, which explicitly specifies linefeed as the newline character. .SH BUILDING SHARED AND STATIC LIBRARIES .rs .sp The PCRE building process uses \fBlibtool\fR to build both shared and static Unix libraries by default. You can suppress one of these by adding one of --disable-shared --disable-static to the \fBconfigure\fR command, as required. .SH POSIX MALLOC USAGE .rs .sp When PCRE is called through the POSIX interface (see the \fBpcreposix\fR documentation), additional working storage is required for holding the pointers to capturing substrings because PCRE requires three integers per substring, whereas the POSIX interface provides only two. If the number of expected substrings is small, the wrapper function uses space on the stack, because this is faster than using \fBmalloc()\fR for each call. The default threshold above which the stack is no longer used is 10; it can be changed by adding a setting such as --with-posix-malloc-threshold=20 to the \fBconfigure\fR command. .SH LIMITING PCRE RESOURCE USAGE .rs .sp Internally, PCRE has a function called \fBmatch()\fR which it calls repeatedly (possibly recursively) when performing a matching operation. By limiting the number of times this function may be called, a limit can be placed on the resources used by a single call to \fBpcre_exec()\fR. The limit can be changed at run time, as described in the \fBpcreapi\fR documentation. The default is 10 million, but this can be changed by adding a setting such as --with-match-limit=500000 to the \fBconfigure\fR command. .SH HANDLING VERY LARGE PATTERNS .rs .sp Within a compiled pattern, offset values are used to point from one part to another (for example, from an opening parenthesis to an alternation metacharacter). By default two-byte values are used for these offsets, leading to a maximum size for a compiled pattern of around 64K. This is sufficient to handle all but the most gigantic patterns. Nevertheless, some people do want to process enormous patterns, so it is possible to compile PCRE to use three-byte or four-byte offsets by adding a setting such as --with-link-size=3 to the \fBconfigure\fR command. The value given must be 2, 3, or 4. Using longer offsets slows down the operation of PCRE because it has to load additional bytes when handling them. If you build PCRE with an increased link size, test 2 (and test 5 if you are using UTF-8) will fail. Part of the output of these tests is a representation of the compiled pattern, and this changes with the link size. .SH AVOIDING EXCESSIVE STACK USAGE .rs .sp PCRE implements backtracking while matching by making recursive calls to an internal function called \fBmatch()\fR. In environments where the size of the stack is limited, this can severely limit PCRE's operation. (The Unix environment does not usually suffer from this problem.) An alternative approach that uses memory from the heap to remember data, instead of using recursive function calls, has been implemented to work round this problem. If you want to build a version of PCRE that works this way, add --disable-stack-for-recursion to the \fBconfigure\fR command. With this configuration, PCRE will use the \fBpcre_stack_malloc\fR and \fBpcre_stack_free\fR variables to call memory management functions. Separate functions are provided because the usage is very predictable: the block sizes requested are always the same, and the blocks are always freed in reverse order. A calling program might be able to implement optimized functions that perform better than the standard \fBmalloc()\fR and \fBfree()\fR functions. PCRE runs noticeably more slowly when built in this way. .SH USING EBCDIC CODE .rs .sp PCRE assumes by default that it will run in an environment where the character code is ASCII (or UTF-8, which is a superset of ASCII). PCRE can, however, be compiled to run in an EBCDIC environment by adding --enable-ebcdic to the \fBconfigure\fR command. .in 0 Last updated: 09 December 2003 .br Copyright (c) 1997-2003 University of Cambridge. 0707010000941e000081a40000000a0000000a00000001402cbcbd00000f52000000880000000500000000000000000000001dff35088ereloc/man/man3/pcrecallout.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH PCRE CALLOUTS .rs .sp .B int (*pcre_callout)(pcre_callout_block *); .PP PCRE provides a feature called "callout", which is a means of temporarily passing control to the caller of PCRE in the middle of pattern matching. The caller of PCRE provides an external function by putting its entry point in the global variable \fIpcre_callout\fR. By default, this variable contains NULL, which disables all calling out. Within a regular expression, (?C) indicates the points at which the external function is to be called. Different callout points can be identified by putting a number less than 256 after the letter C. The default value is zero. For example, this pattern has two callout points: (?C1)\dabc(?C2)def During matching, when PCRE reaches a callout point (and \fIpcre_callout\fR is set), the external function is called. Its only argument is a pointer to a \fBpcre_callout\fR block. This contains the following variables: int \fIversion\fR; int \fIcallout_number\fR; int *\fIoffset_vector\fR; const char *\fIsubject\fR; int \fIsubject_length\fR; int \fIstart_match\fR; int \fIcurrent_position\fR; int \fIcapture_top\fR; int \fIcapture_last\fR; void *\fIcallout_data\fR; The \fIversion\fR field is an integer containing the version number of the block format. The current version is zero. The version number may change in future if additional fields are added, but the intention is never to remove any of the existing fields. The \fIcallout_number\fR field contains the number of the callout, as compiled into the pattern (that is, the number after ?C). The \fIoffset_vector\fR field is a pointer to the vector of offsets that was passed by the caller to \fBpcre_exec()\fR. The contents can be inspected in order to extract substrings that have been matched so far, in the same way as for extracting substrings after a match has completed. The \fIsubject\fR and \fIsubject_length\fR fields contain copies the values that were passed to \fBpcre_exec()\fR. The \fIstart_match\fR field contains the offset within the subject at which the current match attempt started. If the pattern is not anchored, the callout function may be called several times for different starting points. The \fIcurrent_position\fR field contains the offset within the subject of the current match pointer. The \fIcapture_top\fR field contains one more than the number of the highest numbered captured substring so far. If no substrings have been captured, the value of \fIcapture_top\fR is one. The \fIcapture_last\fR field contains the number of the most recently captured substring. The \fIcallout_data\fR field contains a value that is passed to \fBpcre_exec()\fR by the caller specifically so that it can be passed back in callouts. It is passed in the \fIpcre_callout\fR field of the \fBpcre_extra\fR data structure. If no such data was passed, the value of \fIcallout_data\fR in a \fBpcre_callout\fR block is NULL. There is a description of the \fBpcre_extra\fR structure in the \fBpcreapi\fR documentation. .SH RETURN VALUES .rs .sp The callout function returns an integer. If the value is zero, matching proceeds as normal. If the value is greater than zero, matching fails at the current point, but backtracking to test other possibilities goes ahead, just as if a lookahead assertion had failed. If the value is less than zero, the match is abandoned, and \fBpcre_exec()\fR returns the value. Negative values should normally be chosen from the set of PCRE_ERROR_xxx values. In particular, PCRE_ERROR_NOMATCH forces a standard "no match" failure. The error number PCRE_ERROR_CALLOUT is reserved for use by callout functions; it will never be used by PCRE itself. .in 0 Last updated: 21 January 2003 .br Copyright (c) 1997-2003 University of Cambridge. 0707010000941f000081a40000000a0000000a00000001402cbcbd00001103000000880000000500000000000000000000001cff35088ereloc/man/man3/pcrecompat.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH DIFFERENCES FROM PERL .rs .sp This document describes the differences in the ways that PCRE and Perl handle regular expressions. The differences described here are with respect to Perl 5.8. 1. PCRE does not have full UTF-8 support. Details of what it does have are given in the .\" HTML .\" section on UTF-8 support .\" in the main .\" HREF \fBpcre\fR .\" page. 2. PCRE does not allow repeat quantifiers on lookahead assertions. Perl permits them, but they do not mean what you might think. For example, (?!a){3} does not assert that the next three characters are not "a". It just asserts that the next character is not "a" three times. 3. Capturing subpatterns that occur inside negative lookahead assertions are counted, but their entries in the offsets vector are never set. Perl sets its numerical variables from any such patterns that are matched before the assertion fails to match something (thereby succeeding), but only if the negative lookahead assertion contains just one branch. 4. Though binary zero characters are supported in the subject string, they are not allowed in a pattern string because it is passed as a normal C string, terminated by zero. The escape sequence "\\0" can be used in the pattern to represent a binary zero. 5. The following Perl escape sequences are not supported: \\l, \\u, \\L, \\U, \\P, \\p, \\N, and \\X. In fact these are implemented by Perl's general string-handling and are not part of its pattern matching engine. If any of these are encountered by PCRE, an error is generated. 6. PCRE does support the \\Q...\\E escape for quoting substrings. Characters in between are treated as literals. This is slightly different from Perl in that $ and @ are also handled as literals inside the quotes. In Perl, they cause variable interpolation (but of course PCRE does not have variables). Note the following examples: Pattern PCRE matches Perl matches \\Qabc$xyz\\E abc$xyz abc followed by the contents of $xyz \\Qabc\\$xyz\\E abc\\$xyz abc\\$xyz \\Qabc\\E\\$\\Qxyz\\E abc$xyz abc$xyz The \\Q...\\E sequence is recognized both inside and outside character classes. 7. Fairly obviously, PCRE does not support the (?{code}) and (?p{code}) constructions. However, there is some experimental support for recursive patterns using the non-Perl items (?R), (?number) and (?P>name). Also, the PCRE "callout" feature allows an external function to be called during pattern matching. 8. There are some differences that are concerned with the settings of captured strings when part of a pattern is repeated. For example, matching "aba" against the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE it is set to "b". 9. PCRE provides some extensions to the Perl regular expression facilities: (a) Although lookbehind assertions must match fixed length strings, each alternative branch of a lookbehind assertion can match a different length of string. Perl requires them all to have the same length. (b) If PCRE_DOLLAR_ENDONLY is set and PCRE_MULTILINE is not set, the $ meta-character matches only at the very end of the string. (c) If PCRE_EXTRA is set, a backslash followed by a letter with no special meaning is faulted. (d) If PCRE_UNGREEDY is set, the greediness of the repetition quantifiers is inverted, that is, by default they are not greedy, but if followed by a question mark they are. (e) PCRE_ANCHORED can be used to force a pattern to be tried only at the first matching position in the subject string. (f) The PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, and PCRE_NO_AUTO_CAPTURE options for \fBpcre_exec()\fR have no Perl equivalents. (g) The (?R), (?number), and (?P>name) constructs allows for recursive pattern matching (Perl can do this using the (?p{code}) construct, which PCRE cannot support.) (h) PCRE supports named capturing substrings, using the Python syntax. (i) PCRE supports the possessive quantifier "++" syntax, taken from Sun's Java package. (j) The (R) condition, for testing recursion, is a PCRE extension. (k) The callout facility is PCRE-specific. .in 0 Last updated: 09 December 2003 .br Copyright (c) 1997-2003 University of Cambridge. 07070100009420000081a40000000a0000000a00000001402cbcbd0000d7e4000000880000000500000000000000000000001dff35088ereloc/man/man3/pcrepattern.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH PCRE REGULAR EXPRESSION DETAILS .rs .sp The syntax and semantics of the regular expressions supported by PCRE are described below. Regular expressions are also described in the Perl documentation and in a number of other books, some of which have copious examples. Jeffrey Friedl's "Mastering Regular Expressions", published by O'Reilly, covers them in great detail. The description here is intended as reference documentation. The basic operation of PCRE is on strings of bytes. However, there is also support for UTF-8 character strings. To use this support you must build PCRE to include UTF-8 support, and then call \fBpcre_compile()\fR with the PCRE_UTF8 option. How this affects the pattern matching is mentioned in several places below. There is also a summary of UTF-8 features in the .\" HTML .\" section on UTF-8 support .\" in the main .\" HREF \fBpcre\fR .\" page. A regular expression is a pattern that is matched against a subject string from left to right. Most characters stand for themselves in a pattern, and match the corresponding characters in the subject. As a trivial example, the pattern The quick brown fox matches a portion of a subject string that is identical to itself. The power of regular expressions comes from the ability to include alternatives and repetitions in the pattern. These are encoded in the pattern by the use of \fImeta-characters\fR, which do not stand for themselves but instead are interpreted in some special way. There are two different sets of meta-characters: those that are recognized anywhere in the pattern except within square brackets, and those that are recognized in square brackets. Outside square brackets, the meta-characters are as follows: \\ general escape character with several uses ^ assert start of string (or line, in multiline mode) $ assert end of string (or line, in multiline mode) . match any character except newline (by default) [ start character class definition | start of alternative branch ( start subpattern ) end subpattern ? extends the meaning of ( also 0 or 1 quantifier also quantifier minimizer * 0 or more quantifier + 1 or more quantifier also "possessive quantifier" { start min/max quantifier Part of a pattern that is in square brackets is called a "character class". In a character class the only meta-characters are: \\ general escape character ^ negate the class, but only if the first character - indicates character range [ POSIX character class (only if followed by POSIX syntax) ] terminates the character class The following sections describe the use of each of the meta-characters. .SH BACKSLASH .rs .sp The backslash character has several uses. Firstly, if it is followed by a non-alphameric character, it takes away any special meaning that character may have. This use of backslash as an escape character applies both inside and outside character classes. For example, if you want to match a * character, you write \\* in the pattern. This escaping action applies whether or not the following character would otherwise be interpreted as a meta-character, so it is always safe to precede a non-alphameric with backslash to specify that it stands for itself. In particular, if you want to match a backslash, you write \\\\. If a pattern is compiled with the PCRE_EXTENDED option, whitespace in the pattern (other than in a character class) and characters between a # outside a character class and the next newline character are ignored. An escaping backslash can be used to include a whitespace or # character as part of the pattern. If you want to remove the special meaning from a sequence of characters, you can do so by putting them between \\Q and \\E. This is different from Perl in that $ and @ are handled as literals in \\Q...\\E sequences in PCRE, whereas in Perl, $ and @ cause variable interpolation. Note the following examples: Pattern PCRE matches Perl matches \\Qabc$xyz\\E abc$xyz abc followed by the contents of $xyz \\Qabc\\$xyz\\E abc\\$xyz abc\\$xyz \\Qabc\\E\\$\\Qxyz\\E abc$xyz abc$xyz The \\Q...\\E sequence is recognized both inside and outside character classes. A second use of backslash provides a way of encoding non-printing characters in patterns in a visible manner. There is no restriction on the appearance of non-printing characters, apart from the binary zero that terminates a pattern, but when a pattern is being prepared by text editing, it is usually easier to use one of the following escape sequences than the binary character it represents: \\a alarm, that is, the BEL character (hex 07) \\cx "control-x", where x is any character \\e escape (hex 1B) \\f formfeed (hex 0C) \\n newline (hex 0A) \\r carriage return (hex 0D) \\t tab (hex 09) \\ddd character with octal code ddd, or backreference \\xhh character with hex code hh \\x{hhh..} character with hex code hhh... (UTF-8 mode only) The precise effect of \\cx is as follows: if x is a lower case letter, it is converted to upper case. Then bit 6 of the character (hex 40) is inverted. Thus \\cz becomes hex 1A, but \\c{ becomes hex 3B, while \\c; becomes hex 7B. After \\x, from zero to two hexadecimal digits are read (letters can be in upper or lower case). In UTF-8 mode, any number of hexadecimal digits may appear between \\x{ and }, but the value of the character code must be less than 2**31 (that is, the maximum hexadecimal value is 7FFFFFFF). If characters other than hexadecimal digits appear between \\x{ and }, or if there is no terminating }, this form of escape is not recognized. Instead, the initial \\x will be interpreted as a basic hexadecimal escape, with no following digits, giving a byte whose value is zero. Characters whose value is less than 256 can be defined by either of the two syntaxes for \\x when PCRE is in UTF-8 mode. There is no difference in the way they are handled. For example, \\xdc is exactly the same as \\x{dc}. After \\0 up to two further octal digits are read. In both cases, if there are fewer than two digits, just those that are present are used. Thus the sequence \\0\\x\\07 specifies two binary zeros followed by a BEL character (code value 7). Make sure you supply two digits after the initial zero if the character that follows is itself an octal digit. The handling of a backslash followed by a digit other than 0 is complicated. Outside a character class, PCRE reads it and any following digits as a decimal number. If the number is less than 10, or if there have been at least that many previous capturing left parentheses in the expression, the entire sequence is taken as a \fIback reference\fR. A description of how this works is given later, following the discussion of parenthesized subpatterns. Inside a character class, or if the decimal number is greater than 9 and there have not been that many capturing subpatterns, PCRE re-reads up to three octal digits following the backslash, and generates a single byte from the least significant 8 bits of the value. Any subsequent digits stand for themselves. For example: \\040 is another way of writing a space \\40 is the same, provided there are fewer than 40 previous capturing subpatterns \\7 is always a back reference \\11 might be a back reference, or another way of writing a tab \\011 is always a tab \\0113 is a tab followed by the character "3" \\113 might be a back reference, otherwise the character with octal code 113 \\377 might be a back reference, otherwise the byte consisting entirely of 1 bits \\81 is either a back reference, or a binary zero followed by the two characters "8" and "1" Note that octal values of 100 or greater must not be introduced by a leading zero, because no more than three octal digits are ever read. All the sequences that define a single byte value or a single UTF-8 character (in UTF-8 mode) can be used both inside and outside character classes. In addition, inside a character class, the sequence \\b is interpreted as the backspace character (hex 08). Outside a character class it has a different meaning (see below). The third use of backslash is for specifying generic character types: \\d any decimal digit \\D any character that is not a decimal digit \\s any whitespace character \\S any character that is not a whitespace character \\w any "word" character \\W any "non-word" character Each pair of escape sequences partitions the complete set of characters into two disjoint sets. Any given character matches one, and only one, of each pair. In UTF-8 mode, characters with values greater than 255 never match \\d, \\s, or \\w, and always match \\D, \\S, and \\W. For compatibility with Perl, \\s does not match the VT character (code 11). This makes it different from the the POSIX "space" class. The \\s characters are HT (9), LF (10), FF (12), CR (13), and space (32). A "word" character is any letter or digit or the underscore character, that is, any character which can be part of a Perl "word". The definition of letters and digits is controlled by PCRE's character tables, and may vary if locale- specific matching is taking place (see .\" HTML .\" "Locale support" .\" in the .\" HREF \fBpcreapi\fR .\" page). For example, in the "fr" (French) locale, some character codes greater than 128 are used for accented letters, and these are matched by \\w. These character type sequences can appear both inside and outside character classes. They each match one character of the appropriate type. If the current matching point is at the end of the subject string, all of them fail, since there is no character to match. The fourth use of backslash is for certain simple assertions. An assertion specifies a condition that has to be met at a particular point in a match, without consuming any characters from the subject string. The use of subpatterns for more complicated assertions is described below. The backslashed assertions are \\b matches at a word boundary \\B matches when not at a word boundary \\A matches at start of subject \\Z matches at end of subject or before newline at end \\z matches at end of subject \\G matches at first matching position in subject These assertions may not appear in character classes (but note that \\b has a different meaning, namely the backspace character, inside a character class). A word boundary is a position in the subject string where the current character and the previous character do not both match \\w or \\W (i.e. one matches \\w and the other matches \\W), or the start or end of the string if the first or last character matches \\w, respectively. The \\A, \\Z, and \\z assertions differ from the traditional circumflex and dollar (described below) in that they only ever match at the very start and end of the subject string, whatever options are set. Thus, they are independent of multiline mode. They are not affected by the PCRE_NOTBOL or PCRE_NOTEOL options. If the \fIstartoffset\fR argument of \fBpcre_exec()\fR is non-zero, indicating that matching is to start at a point other than the beginning of the subject, \\A can never match. The difference between \\Z and \\z is that \\Z matches before a newline that is the last character of the string as well as at the end of the string, whereas \\z matches only at the end. The \\G assertion is true only when the current matching position is at the start point of the match, as specified by the \fIstartoffset\fR argument of \fBpcre_exec()\fR. It differs from \\A when the value of \fIstartoffset\fR is non-zero. By calling \fBpcre_exec()\fR multiple times with appropriate arguments, you can mimic Perl's /g option, and it is in this kind of implementation where \\G can be useful. Note, however, that PCRE's interpretation of \\G, as the start of the current match, is subtly different from Perl's, which defines it as the end of the previous match. In Perl, these can be different when the previously matched string was empty. Because PCRE does just one match at a time, it cannot reproduce this behaviour. If all the alternatives of a pattern begin with \\G, the expression is anchored to the starting match position, and the "anchored" flag is set in the compiled regular expression. .SH CIRCUMFLEX AND DOLLAR .rs .sp Outside a character class, in the default matching mode, the circumflex character is an assertion which is true only if the current matching point is at the start of the subject string. If the \fIstartoffset\fR argument of \fBpcre_exec()\fR is non-zero, circumflex can never match if the PCRE_MULTILINE option is unset. Inside a character class, circumflex has an entirely different meaning (see below). Circumflex need not be the first character of the pattern if a number of alternatives are involved, but it should be the first thing in each alternative in which it appears if the pattern is ever to match that branch. If all possible alternatives start with a circumflex, that is, if the pattern is constrained to match only at the start of the subject, it is said to be an "anchored" pattern. (There are also other constructs that can cause a pattern to be anchored.) A dollar character is an assertion which is true only if the current matching point is at the end of the subject string, or immediately before a newline character that is the last character in the string (by default). Dollar need not be the last character of the pattern if a number of alternatives are involved, but it should be the last item in any branch in which it appears. Dollar has no special meaning in a character class. The meaning of dollar can be changed so that it matches only at the very end of the string, by setting the PCRE_DOLLAR_ENDONLY option at compile time. This does not affect the \\Z assertion. The meanings of the circumflex and dollar characters are changed if the PCRE_MULTILINE option is set. When this is the case, they match immediately after and immediately before an internal newline character, respectively, in addition to matching at the start and end of the subject string. For example, the pattern /^abc$/ matches the subject string "def\\nabc" in multiline mode, but not otherwise. Consequently, patterns that are anchored in single line mode because all branches start with ^ are not anchored in multiline mode, and a match for circumflex is possible when the \fIstartoffset\fR argument of \fBpcre_exec()\fR is non-zero. The PCRE_DOLLAR_ENDONLY option is ignored if PCRE_MULTILINE is set. Note that the sequences \\A, \\Z, and \\z can be used to match the start and end of the subject in both modes, and if all branches of a pattern start with \\A it is always anchored, whether PCRE_MULTILINE is set or not. .SH FULL STOP (PERIOD, DOT) .rs .sp Outside a character class, a dot in the pattern matches any one character in the subject, including a non-printing character, but not (by default) newline. In UTF-8 mode, a dot matches any UTF-8 character, which might be more than one byte long, except (by default) for newline. If the PCRE_DOTALL option is set, dots match newlines as well. The handling of dot is entirely independent of the handling of circumflex and dollar, the only relationship being that they both involve newline characters. Dot has no special meaning in a character class. .SH MATCHING A SINGLE BYTE .rs .sp Outside a character class, the escape sequence \\C matches any one byte, both in and out of UTF-8 mode. Unlike a dot, it always matches a newline. The feature is provided in Perl in order to match individual bytes in UTF-8 mode. Because it breaks up UTF-8 characters into individual bytes, what remains in the string may be a malformed UTF-8 string. For this reason it is best avoided. PCRE does not allow \\C to appear in lookbehind assertions (see below), because in UTF-8 mode it makes it impossible to calculate the length of the lookbehind. .SH SQUARE BRACKETS .rs .sp An opening square bracket introduces a character class, terminated by a closing square bracket. A closing square bracket on its own is not special. If a closing square bracket is required as a member of the class, it should be the first data character in the class (after an initial circumflex, if present) or escaped with a backslash. A character class matches a single character in the subject. In UTF-8 mode, the character may occupy more than one byte. A matched character must be in the set of characters defined by the class, unless the first character in the class definition is a circumflex, in which case the subject character must not be in the set defined by the class. If a circumflex is actually required as a member of the class, ensure it is not the first character, or escape it with a backslash. For example, the character class [aeiou] matches any lower case vowel, while [^aeiou] matches any character that is not a lower case vowel. Note that a circumflex is just a convenient notation for specifying the characters which are in the class by enumerating those that are not. It is not an assertion: it still consumes a character from the subject string, and fails if the current pointer is at the end of the string. In UTF-8 mode, characters with values greater than 255 can be included in a class as a literal string of bytes, or by using the \\x{ escaping mechanism. When caseless matching is set, any letters in a class represent both their upper case and lower case versions, so for example, a caseless [aeiou] matches "A" as well as "a", and a caseless [^aeiou] does not match "A", whereas a caseful version would. PCRE does not support the concept of case for characters with values greater than 255. The newline character is never treated in any special way in character classes, whatever the setting of the PCRE_DOTALL or PCRE_MULTILINE options is. A class such as [^a] will always match a newline. The minus (hyphen) character can be used to specify a range of characters in a character class. For example, [d-m] matches any letter between d and m, inclusive. If a minus character is required in a class, it must be escaped with a backslash or appear in a position where it cannot be interpreted as indicating a range, typically as the first or last character in the class. It is not possible to have the literal character "]" as the end character of a range. A pattern such as [W-]46] is interpreted as a class of two characters ("W" and "-") followed by a literal string "46]", so it would match "W46]" or "-46]". However, if the "]" is escaped with a backslash it is interpreted as the end of range, so [W-\\]46] is interpreted as a single class containing a range followed by two separate characters. The octal or hexadecimal representation of "]" can also be used to end a range. Ranges operate in the collating sequence of character values. They can also be used for characters specified numerically, for example [\\000-\\037]. In UTF-8 mode, ranges can include characters whose values are greater than 255, for example [\\x{100}-\\x{2ff}]. If a range that includes letters is used when caseless matching is set, it matches the letters in either case. For example, [W-c] is equivalent to [][\\^_`wxyzabc], matched caselessly, and if character tables for the "fr" locale are in use, [\\xc8-\\xcb] matches accented E characters in both cases. The character types \\d, \\D, \\s, \\S, \\w, and \\W may also appear in a character class, and add the characters that they match to the class. For example, [\\dABCDEF] matches any hexadecimal digit. A circumflex can conveniently be used with the upper case character types to specify a more restricted set of characters than the matching lower case type. For example, the class [^\\W_] matches any letter or digit, but not underscore. All non-alphameric characters other than \\, -, ^ (at the start) and the terminating ] are non-special in character classes, but it does no harm if they are escaped. .SH POSIX CHARACTER CLASSES .rs .sp Perl supports the POSIX notation for character classes, which uses names enclosed by [: and :] within the enclosing square brackets. PCRE also supports this notation. For example, [01[:alpha:]%] matches "0", "1", any alphabetic character, or "%". The supported class names are alnum letters and digits alpha letters ascii character codes 0 - 127 blank space or tab only cntrl control characters digit decimal digits (same as \\d) graph printing characters, excluding space lower lower case letters print printing characters, including space punct printing characters, excluding letters and digits space white space (not quite the same as \\s) upper upper case letters word "word" characters (same as \\w) xdigit hexadecimal digits The "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), and space (32). Notice that this list includes the VT character (code 11). This makes "space" different to \\s, which does not include VT (for Perl compatibility). The name "word" is a Perl extension, and "blank" is a GNU extension from Perl 5.8. Another Perl extension is negation, which is indicated by a ^ character after the colon. For example, [12[:^digit:]] matches "1", "2", or any non-digit. PCRE (and Perl) also recognize the POSIX syntax [.ch.] and [=ch=] where "ch" is a "collating element", but these are not supported, and an error is given if they are encountered. In UTF-8 mode, characters with values greater than 255 do not match any of the POSIX character classes. .SH VERTICAL BAR .rs .sp Vertical bar characters are used to separate alternative patterns. For example, the pattern gilbert|sullivan matches either "gilbert" or "sullivan". Any number of alternatives may appear, and an empty alternative is permitted (matching the empty string). The matching process tries each alternative in turn, from left to right, and the first one that succeeds is used. If the alternatives are within a subpattern (defined below), "succeeds" means matching the rest of the main pattern as well as the alternative in the subpattern. .SH INTERNAL OPTION SETTING .rs .sp The settings of the PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, and PCRE_EXTENDED options can be changed from within the pattern by a sequence of Perl option letters enclosed between "(?" and ")". The option letters are i for PCRE_CASELESS m for PCRE_MULTILINE s for PCRE_DOTALL x for PCRE_EXTENDED For example, (?im) sets caseless, multiline matching. It is also possible to unset these options by preceding the letter with a hyphen, and a combined setting and unsetting such as (?im-sx), which sets PCRE_CASELESS and PCRE_MULTILINE while unsetting PCRE_DOTALL and PCRE_EXTENDED, is also permitted. If a letter appears both before and after the hyphen, the option is unset. When an option change occurs at top level (that is, not inside subpattern parentheses), the change applies to the remainder of the pattern that follows. If the change is placed right at the start of a pattern, PCRE extracts it into the global options (and it will therefore show up in data extracted by the \fBpcre_fullinfo()\fR function). An option change within a subpattern affects only that part of the current pattern that follows it, so (a(?i)b)c matches abc and aBc and no other strings (assuming PCRE_CASELESS is not used). By this means, options can be made to have different settings in different parts of the pattern. Any changes made in one alternative do carry on into subsequent branches within the same subpattern. For example, (a(?i)b|c) matches "ab", "aB", "c", and "C", even though when matching "C" the first branch is abandoned before the option setting. This is because the effects of option settings happen at compile time. There would be some very weird behaviour otherwise. The PCRE-specific options PCRE_UNGREEDY and PCRE_EXTRA can be changed in the same way as the Perl-compatible options by using the characters U and X respectively. The (?X) flag setting is special in that it must always occur earlier in the pattern than any of the additional features it turns on, even when it is at top level. It is best put at the start. .SH SUBPATTERNS .rs .sp Subpatterns are delimited by parentheses (round brackets), which can be nested. Marking part of a pattern as a subpattern does two things: 1. It localizes a set of alternatives. For example, the pattern cat(aract|erpillar|) matches one of the words "cat", "cataract", or "caterpillar". Without the parentheses, it would match "cataract", "erpillar" or the empty string. 2. It sets up the subpattern as a capturing subpattern (as defined above). When the whole pattern matches, that portion of the subject string that matched the subpattern is passed back to the caller via the \fIovector\fR argument of \fBpcre_exec()\fR. Opening parentheses are counted from left to right (starting from 1) to obtain the numbers of the capturing subpatterns. For example, if the string "the red king" is matched against the pattern the ((red|white) (king|queen)) the captured substrings are "red king", "red", and "king", and are numbered 1, 2, and 3, respectively. The fact that plain parentheses fulfil two functions is not always helpful. There are often times when a grouping subpattern is required without a capturing requirement. If an opening parenthesis is followed by a question mark and a colon, the subpattern does not do any capturing, and is not counted when computing the number of any subsequent capturing subpatterns. For example, if the string "the white queen" is matched against the pattern the ((?:red|white) (king|queen)) the captured substrings are "white queen" and "queen", and are numbered 1 and 2. The maximum number of capturing subpatterns is 65535, and the maximum depth of nesting of all subpatterns, both capturing and non-capturing, is 200. As a convenient shorthand, if any option settings are required at the start of a non-capturing subpattern, the option letters may appear between the "?" and the ":". Thus the two patterns (?i:saturday|sunday) (?:(?i)saturday|sunday) match exactly the same set of strings. Because alternative branches are tried from left to right, and options are not reset until the end of the subpattern is reached, an option setting in one branch does affect subsequent branches, so the above patterns match "SUNDAY" as well as "Saturday". .SH NAMED SUBPATTERNS .rs .sp Identifying capturing parentheses by number is simple, but it can be very hard to keep track of the numbers in complicated regular expressions. Furthermore, if an expression is modified, the numbers may change. To help with the difficulty, PCRE supports the naming of subpatterns, something that Perl does not provide. The Python syntax (?P...) is used. Names consist of alphanumeric characters and underscores, and must be unique within a pattern. Named capturing parentheses are still allocated numbers as well as names. The PCRE API provides function calls for extracting the name-to-number translation table from a compiled pattern. For further details see the .\" HREF \fBpcreapi\fR .\" documentation. .SH REPETITION .rs .sp Repetition is specified by quantifiers, which can follow any of the following items: a literal data character the . metacharacter the \\C escape sequence escapes such as \\d that match single characters a character class a back reference (see next section) a parenthesized subpattern (unless it is an assertion) The general repetition quantifier specifies a minimum and maximum number of permitted matches, by giving the two numbers in curly brackets (braces), separated by a comma. The numbers must be less than 65536, and the first must be less than or equal to the second. For example: z{2,4} matches "zz", "zzz", or "zzzz". A closing brace on its own is not a special character. If the second number is omitted, but the comma is present, there is no upper limit; if the second number and the comma are both omitted, the quantifier specifies an exact number of required matches. Thus [aeiou]{3,} matches at least 3 successive vowels, but may match many more, while \\d{8} matches exactly 8 digits. An opening curly bracket that appears in a position where a quantifier is not allowed, or one that does not match the syntax of a quantifier, is taken as a literal character. For example, {,6} is not a quantifier, but a literal string of four characters. In UTF-8 mode, quantifiers apply to UTF-8 characters rather than to individual bytes. Thus, for example, \\x{100}{2} matches two UTF-8 characters, each of which is represented by a two-byte sequence. The quantifier {0} is permitted, causing the expression to behave as if the previous item and the quantifier were not present. For convenience (and historical compatibility) the three most common quantifiers have single-character abbreviations: * is equivalent to {0,} + is equivalent to {1,} ? is equivalent to {0,1} It is possible to construct infinite loops by following a subpattern that can match no characters with a quantifier that has no upper limit, for example: (a?)* Earlier versions of Perl and PCRE used to give an error at compile time for such patterns. However, because there are cases where this can be useful, such patterns are now accepted, but if any repetition of the subpattern does in fact match no characters, the loop is forcibly broken. By default, the quantifiers are "greedy", that is, they match as much as possible (up to the maximum number of permitted times), without causing the rest of the pattern to fail. The classic example of where this gives problems is in trying to match comments in C programs. These appear between the sequences /* and */ and within the sequence, individual * and / characters may appear. An attempt to match C comments by applying the pattern /\\*.*\\*/ to the string /* first command */ not comment /* second comment */ fails, because it matches the entire string owing to the greediness of the .* item. However, if a quantifier is followed by a question mark, it ceases to be greedy, and instead matches the minimum number of times possible, so the pattern /\\*.*?\\*/ does the right thing with the C comments. The meaning of the various quantifiers is not otherwise changed, just the preferred number of matches. Do not confuse this use of question mark with its use as a quantifier in its own right. Because it has two uses, it can sometimes appear doubled, as in \\d??\\d which matches one digit by preference, but can match two if that is the only way the rest of the pattern matches. If the PCRE_UNGREEDY option is set (an option which is not available in Perl), the quantifiers are not greedy by default, but individual ones can be made greedy by following them with a question mark. In other words, it inverts the default behaviour. When a parenthesized subpattern is quantified with a minimum repeat count that is greater than 1 or with a limited maximum, more store is required for the compiled pattern, in proportion to the size of the minimum or maximum. If a pattern starts with .* or .{0,} and the PCRE_DOTALL option (equivalent to Perl's /s) is set, thus allowing the . to match newlines, the pattern is implicitly anchored, because whatever follows will be tried against every character position in the subject string, so there is no point in retrying the overall match at any position after the first. PCRE normally treats such a pattern as though it were preceded by \\A. In cases where it is known that the subject string contains no newlines, it is worth setting PCRE_DOTALL in order to obtain this optimization, or alternatively using ^ to indicate anchoring explicitly. However, there is one situation where the optimization cannot be used. When .* is inside capturing parentheses that are the subject of a backreference elsewhere in the pattern, a match at the start may fail, and a later one succeed. Consider, for example: (.*)abc\\1 If the subject is "xyz123abc123" the match point is the fourth character. For this reason, such a pattern is not implicitly anchored. When a capturing subpattern is repeated, the value captured is the substring that matched the final iteration. For example, after (tweedle[dume]{3}\\s*)+ has matched "tweedledum tweedledee" the value of the captured substring is "tweedledee". However, if there are nested capturing subpatterns, the corresponding captured values may have been set in previous iterations. For example, after /(a|(b))+/ matches "aba" the value of the second captured substring is "b". .SH ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS .rs .sp With both maximizing and minimizing repetition, failure of what follows normally causes the repeated item to be re-evaluated to see if a different number of repeats allows the rest of the pattern to match. Sometimes it is useful to prevent this, either to change the nature of the match, or to cause it fail earlier than it otherwise might, when the author of the pattern knows there is no point in carrying on. Consider, for example, the pattern \\d+foo when applied to the subject line 123456bar After matching all 6 digits and then failing to match "foo", the normal action of the matcher is to try again with only 5 digits matching the \\d+ item, and then with 4, and so on, before ultimately failing. "Atomic grouping" (a term taken from Jeffrey Friedl's book) provides the means for specifying that once a subpattern has matched, it is not to be re-evaluated in this way. If we use atomic grouping for the previous example, the matcher would give up immediately on failing to match "foo" the first time. The notation is a kind of special parenthesis, starting with (?> as in this example: (?>\\d+)foo This kind of parenthesis "locks up" the part of the pattern it contains once it has matched, and a failure further into the pattern is prevented from backtracking into it. Backtracking past it to previous items, however, works as normal. An alternative description is that a subpattern of this type matches the string of characters that an identical standalone pattern would match, if anchored at the current point in the subject string. Atomic grouping subpatterns are not capturing subpatterns. Simple cases such as the above example can be thought of as a maximizing repeat that must swallow everything it can. So, while both \\d+ and \\d+? are prepared to adjust the number of digits they match in order to make the rest of the pattern match, (?>\\d+) can only match an entire sequence of digits. Atomic groups in general can of course contain arbitrarily complicated subpatterns, and can be nested. However, when the subpattern for an atomic group is just a single repeated item, as in the example above, a simpler notation, called a "possessive quantifier" can be used. This consists of an additional + character following a quantifier. Using this notation, the previous example can be rewritten as \\d++bar Possessive quantifiers are always greedy; the setting of the PCRE_UNGREEDY option is ignored. They are a convenient notation for the simpler forms of atomic group. However, there is no difference in the meaning or processing of a possessive quantifier and the equivalent atomic group. The possessive quantifier syntax is an extension to the Perl syntax. It originates in Sun's Java package. When a pattern contains an unlimited repeat inside a subpattern that can itself be repeated an unlimited number of times, the use of an atomic group is the only way to avoid some failing matches taking a very long time indeed. The pattern (\\D+|<\\d+>)*[!?] matches an unlimited number of substrings that either consist of non-digits, or digits enclosed in <>, followed by either ! or ?. When it matches, it runs quickly. However, if it is applied to aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa it takes a long time before reporting failure. This is because the string can be divided between the two repeats in a large number of ways, and all have to be tried. (The example used [!?] rather than a single character at the end, because both PCRE and Perl have an optimization that allows for fast failure when a single character is used. They remember the last single character that is required for a match, and fail early if it is not present in the string.) If the pattern is changed to ((?>\\D+)|<\\d+>)*[!?] sequences of non-digits cannot be broken, and failure happens quickly. .SH BACK REFERENCES .rs .sp Outside a character class, a backslash followed by a digit greater than 0 (and possibly further digits) is a back reference to a capturing subpattern earlier (that is, to its left) in the pattern, provided there have been that many previous capturing left parentheses. However, if the decimal number following the backslash is less than 10, it is always taken as a back reference, and causes an error only if there are not that many capturing left parentheses in the entire pattern. In other words, the parentheses that are referenced need not be to the left of the reference for numbers less than 10. See the section entitled "Backslash" above for further details of the handling of digits following a backslash. A back reference matches whatever actually matched the capturing subpattern in the current subject string, rather than anything matching the subpattern itself (see .\" HTML .\" "Subpatterns as subroutines" .\" below for a way of doing that). So the pattern (sens|respons)e and \\1ibility matches "sense and sensibility" and "response and responsibility", but not "sense and responsibility". If caseful matching is in force at the time of the back reference, the case of letters is relevant. For example, ((?i)rah)\\s+\\1 matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original capturing subpattern is matched caselessly. Back references to named subpatterns use the Python syntax (?P=name). We could rewrite the above example as follows: (?(?i)rah)\\s+(?P=p1) There may be more than one back reference to the same subpattern. If a subpattern has not actually been used in a particular match, any back references to it always fail. For example, the pattern (a|(bc))\\2 always fails if it starts to match "a" rather than "bc". Because there may be many capturing parentheses in a pattern, all digits following the backslash are taken as part of a potential back reference number. If the pattern continues with a digit character, some delimiter must be used to terminate the back reference. If the PCRE_EXTENDED option is set, this can be whitespace. Otherwise an empty comment can be used. A back reference that occurs inside the parentheses to which it refers fails when the subpattern is first used, so, for example, (a\\1) never matches. However, such references can be useful inside repeated subpatterns. For example, the pattern (a|b\\1)+ matches any number of "a"s and also "aba", "ababbaa" etc. At each iteration of the subpattern, the back reference matches the character string corresponding to the previous iteration. In order for this to work, the pattern must be such that the first iteration does not need to match the back reference. This can be done using alternation, as in the example above, or by a quantifier with a minimum of zero. .SH ASSERTIONS .rs .sp An assertion is a test on the characters following or preceding the current matching point that does not actually consume any characters. The simple assertions coded as \\b, \\B, \\A, \\G, \\Z, \\z, ^ and $ are described above. More complicated assertions are coded as subpatterns. There are two kinds: those that look ahead of the current position in the subject string, and those that look behind it. An assertion subpattern is matched in the normal way, except that it does not cause the current matching position to be changed. Lookahead assertions start with (?= for positive assertions and (?! for negative assertions. For example, \\w+(?=;) matches a word followed by a semicolon, but does not include the semicolon in the match, and foo(?!bar) matches any occurrence of "foo" that is not followed by "bar". Note that the apparently similar pattern (?!foo)bar does not find an occurrence of "bar" that is preceded by something other than "foo"; it finds any occurrence of "bar" whatsoever, because the assertion (?!foo) is always true when the next three characters are "bar". A lookbehind assertion is needed to achieve this effect. If you want to force a matching failure at some point in a pattern, the most convenient way to do it is with (?!) because an empty string always matches, so an assertion that requires there not to be an empty string must always fail. Lookbehind assertions start with (?<= for positive assertions and (?.*)(?<=abcd) or, equivalently, ^.*+(?<=abcd) there can be no backtracking for the .* item; it can match only the entire string. The subsequent lookbehind assertion does a single test on the last four characters. If it fails, the match fails immediately. For long strings, this approach makes a significant difference to the processing time. Several assertions (of any sort) may occur in succession. For example, (?<=\\d{3})(?[^()]+) | (?p{$re}) )* \\)}x; The (?p{...}) item interpolates Perl code at run time, and in this case refers recursively to the pattern in which it appears. Obviously, PCRE cannot support the interpolation of Perl code. Instead, it supports some special syntax for recursion of the entire pattern, and also for individual subpattern recursion. The special item that consists of (? followed by a number greater than zero and a closing parenthesis is a recursive call of the subpattern of the given number, provided that it occurs inside that subpattern. (If not, it is a "subroutine" call, which is described in the next section.) The special item (?R) is a recursive call of the entire regular expression. For example, this PCRE pattern solves the nested parentheses problem (assume the PCRE_EXTENDED option is set so that white space is ignored): \\( ( (?>[^()]+) | (?R) )* \\) First it matches an opening parenthesis. Then it matches any number of substrings which can either be a sequence of non-parentheses, or a recursive match of the pattern itself (that is a correctly parenthesized substring). Finally there is a closing parenthesis. If this were part of a larger pattern, you would not want to recurse the entire pattern, so instead you could use this: ( \\( ( (?>[^()]+) | (?1) )* \\) ) We have put the pattern into parentheses, and caused the recursion to refer to them instead of the whole pattern. In a larger pattern, keeping track of parenthesis numbers can be tricky. It may be more convenient to use named parentheses instead. For this, PCRE uses (?P>name), which is an extension to the Python syntax that PCRE uses for named parentheses (Perl does not provide named parentheses). We could rewrite the above example as follows: (?P \\( ( (?>[^()]+) | (?P>pn) )* \\) ) This particular example pattern contains nested unlimited repeats, and so the use of atomic grouping for matching strings of non-parentheses is important when applying the pattern to strings that do not match. For example, when this pattern is applied to (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() it yields "no match" quickly. However, if atomic grouping is not used, the match runs for a very long time indeed because there are so many different ways the + and * repeats can carve up the subject, and all have to be tested before failure can be reported. At the end of a match, the values set for any capturing subpatterns are those from the outermost level of the recursion at which the subpattern value is set. If you want to obtain intermediate values, a callout function can be used (see below and the .\" HREF \fBpcrecallout\fR .\" documentation). If the pattern above is matched against (ab(cd)ef) the value for the capturing parentheses is "ef", which is the last value taken on at the top level. If additional parentheses are added, giving \\( ( ( (?>[^()]+) | (?R) )* ) \\) ^ ^ ^ ^ the string they capture is "ab(cd)ef", the contents of the top level parentheses. If there are more than 15 capturing parentheses in a pattern, PCRE has to obtain extra memory to store data during a recursion, which it does by using \fBpcre_malloc\fR, freeing it via \fBpcre_free\fR afterwards. If no memory can be obtained, the match fails with the PCRE_ERROR_NOMEMORY error. Do not confuse the (?R) item with the condition (R), which tests for recursion. Consider this pattern, which matches text in angle brackets, allowing for arbitrary nesting. Only digits are allowed in nested brackets (that is, when recursing), whereas any characters are permitted at the outer level. < (?: (?(R) \\d++ | [^<>]*+) | (?R)) * > In this pattern, (?(R) is the start of a conditional subpattern, with two different alternatives for the recursive and non-recursive cases. The (?R) item is the actual recursive call. .\" HTML .SH SUBPATTERNS AS SUBROUTINES .rs .sp If the syntax for a recursive subpattern reference (either by number or by name) is used outside the parentheses to which it refers, it operates like a subroutine in a programming language. An earlier example pointed out that the pattern (sens|respons)e and \\1ibility matches "sense and sensibility" and "response and responsibility", but not "sense and responsibility". If instead the pattern (sens|respons)e and (?1)ibility is used, it does match "sense and responsibility" as well as the other two strings. Such references must, however, follow the subpattern to which they refer. .SH CALLOUTS .rs .sp Perl has a feature whereby using the sequence (?{...}) causes arbitrary Perl code to be obeyed in the middle of matching a regular expression. This makes it possible, amongst other things, to extract different substrings that match the same pair of parentheses when there is a repetition. PCRE provides a similar feature, but of course it cannot obey arbitrary Perl code. The feature is called "callout". The caller of PCRE provides an external function by putting its entry point in the global variable \fIpcre_callout\fR. By default, this variable contains NULL, which disables all calling out. Within a regular expression, (?C) indicates the points at which the external function is to be called. If you want to identify different callout points, you can put a number less than 256 after the letter C. The default value is zero. For example, this pattern has two callout points: (?C1)\dabc(?C2)def During matching, when PCRE reaches a callout point (and \fIpcre_callout\fR is set), the external function is called. It is provided with the number of the callout, and, optionally, one item of data originally supplied by the caller of \fBpcre_exec()\fR. The callout function may cause matching to backtrack, or to fail altogether. A complete description of the interface to the callout function is given in the .\" HREF \fBpcrecallout\fR .\" documentation. .in 0 Last updated: 03 February 2003 .br Copyright (c) 1997-2003 University of Cambridge. 07070100009421000081a40000000a0000000a00000001402cbcbd00000b81000000880000000500000000000000000000001dff35088ereloc/man/man3/pcreperform.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH PCRE PERFORMANCE .rs .sp Certain items that may appear in regular expression patterns are more efficient than others. It is more efficient to use a character class like [aeiou] than a set of alternatives such as (a|e|i|o|u). In general, the simplest construction that provides the required behaviour is usually the most efficient. Jeffrey Friedl's book contains a lot of discussion about optimizing regular expressions for efficient performance. When a pattern begins with .* not in parentheses, or in parentheses that are not the subject of a backreference, and the PCRE_DOTALL option is set, the pattern is implicitly anchored by PCRE, since it can match only at the start of a subject string. However, if PCRE_DOTALL is not set, PCRE cannot make this optimization, because the . metacharacter does not then match a newline, and if the subject string contains newlines, the pattern may match from the character immediately following one of them instead of from the very start. For example, the pattern .*second matches the subject "first\\nand second" (where \\n stands for a newline character), with the match starting at the seventh character. In order to do this, PCRE has to retry the match starting after every newline in the subject. If you are using such a pattern with subject strings that do not contain newlines, the best performance is obtained by setting PCRE_DOTALL, or starting the pattern with ^.* to indicate explicit anchoring. That saves PCRE from having to scan along the subject looking for a newline to restart at. Beware of patterns that contain nested indefinite repeats. These can take a long time to run when applied to a string that does not match. Consider the pattern fragment (a+)* This can match "aaaa" in 33 different ways, and this number increases very rapidly as the string gets longer. (The * repeat can match 0, 1, 2, 3, or 4 times, and for each of those cases other than 0, the + repeats can match different numbers of times.) When the remainder of the pattern is such that the entire match is going to fail, PCRE has in principle to try every possible variation, and this can take an extremely long time. An optimization catches some of the more simple cases such as (a+)*b where a literal character follows. Before embarking on the standard matching procedure, PCRE checks that there is a "b" later in the subject string, and if there is not, it fails the match immediately. However, when there is no following literal this optimization cannot be used. You can see the difference by comparing the behaviour of (a+)*\\d with the pattern above. The former gives a failure almost instantly when applied to a whole line of "a" characters, whereas the latter takes an appreciable time with strings longer than about 20 characters. .in 0 Last updated: 03 February 2003 .br Copyright (c) 1997-2003 University of Cambridge. 07070100009422000081a40000000a0000000a00000001402cbcbd00001d96000000880000000500000000000000000000001bff35088ereloc/man/man3/pcreposix.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions. .SH SYNOPSIS OF POSIX API .B #include .PP .SM .br .B int regcomp(regex_t *\fIpreg\fR, const char *\fIpattern\fR, .ti +5n .B int \fIcflags\fR); .PP .br .B int regexec(regex_t *\fIpreg\fR, const char *\fIstring\fR, .ti +5n .B size_t \fInmatch\fR, regmatch_t \fIpmatch\fR[], int \fIeflags\fR); .PP .br .B size_t regerror(int \fIerrcode\fR, const regex_t *\fIpreg\fR, .ti +5n .B char *\fIerrbuf\fR, size_t \fIerrbuf_size\fR); .PP .br .B void regfree(regex_t *\fIpreg\fR); .SH DESCRIPTION .rs .sp This set of functions provides a POSIX-style API to the PCRE regular expression package. See the .\" HREF \fBpcreapi\fR .\" documentation for a description of the native API, which contains additional functionality. The functions described here are just wrapper functions that ultimately call the PCRE native API. Their prototypes are defined in the \fBpcreposix.h\fR header file, and on Unix systems the library itself is called \fBpcreposix.a\fR, so can be accessed by adding \fB-lpcreposix\fR to the command for linking an application which uses them. Because the POSIX functions call the native ones, it is also necessary to add \fR-lpcre\fR. I have implemented only those option bits that can be reasonably mapped to PCRE native options. In addition, the options REG_EXTENDED and REG_NOSUB are defined with the value zero. They have no effect, but since programs that are written to the POSIX interface often use them, this makes it easier to slot in PCRE as a replacement library. Other POSIX options are not even defined. When PCRE is called via these functions, it is only the API that is POSIX-like in style. The syntax and semantics of the regular expressions themselves are still those of Perl, subject to the setting of various PCRE options, as described below. "POSIX-like in style" means that the API approximates to the POSIX definition; it is not fully POSIX-compatible, and in multi-byte encoding domains it is probably even less compatible. The header for these functions is supplied as \fBpcreposix.h\fR to avoid any potential clash with other POSIX libraries. It can, of course, be renamed or aliased as \fBregex.h\fR, which is the "correct" name. It provides two structure types, \fIregex_t\fR for compiled internal forms, and \fIregmatch_t\fR for returning captured substrings. It also defines some constants whose names start with "REG_"; these are used for setting options and identifying error codes. .SH COMPILING A PATTERN .rs .sp The function \fBregcomp()\fR is called to compile a pattern into an internal form. The pattern is a C string terminated by a binary zero, and is passed in the argument \fIpattern\fR. The \fIpreg\fR argument is a pointer to a regex_t structure which is used as a base for storing information about the compiled expression. The argument \fIcflags\fR is either zero, or contains one or more of the bits defined by the following macros: REG_ICASE The PCRE_CASELESS option is set when the expression is passed for compilation to the native function. REG_NEWLINE The PCRE_MULTILINE option is set when the expression is passed for compilation to the native function. Note that this does \fInot\fR mimic the defined POSIX behaviour for REG_NEWLINE (see the following section). In the absence of these flags, no options are passed to the native function. This means the the regex is compiled with PCRE default semantics. In particular, the way it handles newline characters in the subject string is the Perl way, not the POSIX way. Note that setting PCRE_MULTILINE has only \fIsome\fR of the effects specified for REG_NEWLINE. It does not affect the way newlines are matched by . (they aren't) or by a negative class such as [^a] (they are). The yield of \fBregcomp()\fR is zero on success, and non-zero otherwise. The \fIpreg\fR structure is filled in on success, and one member of the structure is public: \fIre_nsub\fR contains the number of capturing subpatterns in the regular expression. Various error codes are defined in the header file. .SH MATCHING NEWLINE CHARACTERS .rs .sp This area is not simple, because POSIX and Perl take different views of things. It is not possible to get PCRE to obey POSIX semantics, but then PCRE was never intended to be a POSIX engine. The following table lists the different possibilities for matching newline characters in PCRE: Default Change with . matches newline no PCRE_DOTALL newline matches [^a] yes not changeable $ matches \\n at end yes PCRE_DOLLARENDONLY $ matches \\n in middle no PCRE_MULTILINE ^ matches \\n in middle no PCRE_MULTILINE This is the equivalent table for POSIX: Default Change with . matches newline yes REG_NEWLINE newline matches [^a] yes REG_NEWLINE $ matches \\n at end no REG_NEWLINE $ matches \\n in middle no REG_NEWLINE ^ matches \\n in middle no REG_NEWLINE PCRE's behaviour is the same as Perl's, except that there is no equivalent for PCRE_DOLLARENDONLY in Perl. In both PCRE and Perl, there is no way to stop newline from matching [^a]. The default POSIX newline handling can be obtained by setting PCRE_DOTALL and PCRE_DOLLARENDONLY, but there is no way to make PCRE behave exactly as for the REG_NEWLINE action. .SH MATCHING A PATTERN .rs .sp The function \fBregexec()\fR is called to match a pre-compiled pattern \fIpreg\fR against a given \fIstring\fR, which is terminated by a zero byte, subject to the options in \fIeflags\fR. These can be: REG_NOTBOL The PCRE_NOTBOL option is set when calling the underlying PCRE matching function. REG_NOTEOL The PCRE_NOTEOL option is set when calling the underlying PCRE matching function. The portion of the string that was matched, and also any captured substrings, are returned via the \fIpmatch\fR argument, which points to an array of \fInmatch\fR structures of type \fIregmatch_t\fR, containing the members \fIrm_so\fR and \fIrm_eo\fR. These contain the offset to the first character of each substring and the offset to the first character after the end of each substring, respectively. The 0th element of the vector relates to the entire portion of \fIstring\fR that was matched; subsequent elements relate to the capturing subpatterns of the regular expression. Unused entries in the array have both structure members set to -1. A successful match yields a zero return; various error codes are defined in the header file, of which REG_NOMATCH is the "expected" failure code. .SH ERROR MESSAGES .rs .sp The \fBregerror()\fR function maps a non-zero errorcode from either \fBregcomp()\fR or \fBregexec()\fR to a printable message. If \fIpreg\fR is not NULL, the error should have arisen from the use of that structure. A message terminated by a binary zero is placed in \fIerrbuf\fR. The length of the message, including the zero, is limited to \fIerrbuf_size\fR. The yield of the function is the size of buffer needed to hold the whole message. .SH STORAGE .rs .sp Compiling a regular expression causes memory to be allocated and associated with the \fIpreg\fR structure. The function \fBregfree()\fR frees all such memory, after which \fIpreg\fR may no longer be used as a compiled expression. .SH AUTHOR .rs .sp Philip Hazel .br University Computing Service, .br Cambridge CB2 3QG, England. .in 0 Last updated: 03 February 2003 .br Copyright (c) 1997-2003 University of Cambridge. 07070100009423000081a40000000a0000000a00000001402cbcbd0000077b000000880000000500000000000000000000001cff35088ereloc/man/man3/pcresample.3.TH PCRE 3 .SH NAME PCRE - Perl-compatible regular expressions .SH PCRE SAMPLE PROGRAM .rs .sp A simple, complete demonstration program, to get you started with using PCRE, is supplied in the file \fIpcredemo.c\fR in the PCRE distribution. The program compiles the regular expression that is its first argument, and matches it against the subject string in its second argument. No PCRE options are set, and default character tables are used. If matching succeeds, the program outputs the portion of the subject that matched, together with the contents of any captured substrings. If the -g option is given on the command line, the program then goes on to check for further matches of the same regular expression in the same subject string. The logic is a little bit tricky because of the possibility of matching an empty string. Comments in the code explain what is going on. On a Unix system that has PCRE installed in \fI/usr/local\fR, you can compile the demonstration program using a command like this: gcc -o pcredemo pcredemo.c -I/usr/local/include \\ -L/usr/local/lib -lpcre Then you can run simple tests like this: ./pcredemo 'cat|dog' 'the cat sat on the mat' ./pcredemo -g 'cat|dog' 'the dog sat on the cat' Note that there is a much more comprehensive test program, called \fBpcretest\fR, which supports many more facilities for testing regular expressions and the PCRE library. The \fBpcredemo\fR program is provided as a simple coding example. On some operating systems (e.g. Solaris) you may get an error like this when you try to run \fBpcredemo\fR: ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or directory This is caused by the way shared library support works on those systems. You need to add -R/usr/local/lib to the compile command to get round this problem. .in 0 Last updated: 28 January 2003 .br Copyright (c) 1997-2003 University of Cambridge. 07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!!