Commit Graph
52 Commits
Author SHA1 Message Date
SVN Migration 1408a2e29c This commit was manufactured by cvs2svn to create tag 'before-sapi-split'. 1999-09-26 20:17:29 +00:00
Andrey Hristov bfa7b6b145 - Updated array functions to use high-performance API
- Updated preg_split() to allow returning only non-empty pieces
1999-09-24 22:44:41 +00:00
Andrey Hristov ba01cefc0c Update to new high-performance function API. 1999-09-24 20:11:06 +00:00
Andrey Hristov 9f07657b48 Small clarification. 1999-09-23 15:37:01 +00:00
Sascha Schumann e20af627c2 improve short help messages 1999-09-16 15:35:49 +00:00
Andrey Hristov 870a6679ff - Updated bundled PCRE library to version 2.08
- Made it possible to specify external location of the PCRE library
- Reworked PCRE extension to use updated PCRE library API

Hopefully now everything behaves just like Perl..
1999-09-14 19:24:37 +00:00
Andrey Hristov 5e4a85f2e3 Static is good... 1999-09-03 21:12:10 +00:00
Andrey Hristov f72897c29d Practice what you preach, I guess. 1999-09-03 19:01:19 +00:00
Rasmus Lerdorf 8ccce347a3 Missing return types in prototypes 1999-08-26 14:13:14 +00:00
Egon Schmid 17f132f9ee Here was also something missing 1999-08-19 20:31:57 +00:00
Andi Gutmans aeec4e198a - Fixed memory leaks. tsrm resource id deallocation still needs to be implemented. 1999-08-19 16:52:53 +00:00
Philippe Verdy 236d54114c make pcre test program compile again with Zeev's
additions in the pcre_exec() function parameters
1999-08-15 23:52:37 +00:00
Zeev Suraski 3cb1eb0471 Removed '3' from key functions in PHP (maintained compatibility through
php3_compat.h)
1999-08-02 19:17:14 +00:00
Egon Schmid b55a6c9185 Another forgotten prototype. Andrey, why is preg_grep in PHP3 missing? 1999-08-01 18:18:40 +00:00
Andrey Hristov a5a07063d2 *** empty log message *** 1999-07-22 14:22:32 +00:00
Andrey Hristov 6b82192bf7 Added locale support. 1999-07-20 20:57:04 +00:00
Andrey Hristov 3335c8ea0d -Kill compile warnings in apache.c
-Make preg_grep() work with copies of array entries
1999-07-17 20:03:10 +00:00
Zeev Suraski c5724cbd14 License update 1999-07-16 13:13:16 +00:00
Andrey Hristov be66f224b0 *** empty log message *** 1999-07-12 17:16:14 +00:00
Zeev Suraski c43c235427 Don't touch refcount and EA directly 1999-07-09 20:45:55 +00:00
Zeev Suraski 5f62c347c7 Step 2:
Rename is_ref to EA
1999-07-09 17:44:41 +00:00
Zeev Suraski 3a9cb0220c Step 1 in nuking the garbage collector:
- Change the hash destructor to return int
1999-07-09 17:36:12 +00:00
Andrey Hristov cef4df1fee Reduce clutter a bit. 1999-07-08 21:42:29 +00:00
Zeev Suraski 5baaa716dc Support PCRE under Win32 1999-07-06 19:49:48 +00:00
Zeev Suraski 8ee9fd5768 avoid two copies of pcre.c in the repository 1999-07-06 19:24:13 +00:00
Andrey Hristov 7aa981f5b7 Correct option caching 1999-07-05 15:25:51 +00:00
Andrey Hristov 31c8ec4c80 Made preg_split() consistent with split().
Added a new /e modifier for preg_replace
Kill a warning in pcrelib.
1999-06-22 14:56:32 +00:00
Andrey Hristov 3b1843bc9f Added preg_grep() function. 1999-06-10 14:41:38 +00:00
Andrey Hristov b331ead5bf A fix for a fix. 1999-06-09 21:21:27 +00:00
Andrey Hristov 3d45dd58b8 Fixed a bug in preg_split.
Fixed a bug in array_shift/array_pop.
1999-06-09 21:13:05 +00:00
Andrey Hristov 2a64925a67 Fixed a bug in preg_replace. 1999-06-09 15:02:57 +00:00
Andrey Hristov dbfeaabb16 Added preg_quote() function. 1999-06-04 13:56:23 +00:00
Andrey Hristov c7a606c4a3 *** empty log message *** 1999-06-04 13:37:44 +00:00
Andrey Hristov aea7498779 *** empty log message *** 1999-06-01 20:31:39 +00:00
Andrey Hristov aba3ea97cd preg_match_all() now returns the number of global matches. 1999-05-30 14:48:39 +00:00
Andrey Hristov a88b37788e Updated preg_split(). 1999-05-29 20:45:00 +00:00
Andrey Hristov 70dc46892a Fix preg_match_all to do proper matching with \b. 1999-05-29 20:04:05 +00:00
Andrey Hristov 9c970e1910 Fixed PCRE so that global matching with patterns with \b works. 1999-05-29 19:38:50 +00:00
Zeev Suraski 0eb1498fa8 * Get Apache module to compile again with the regex stuff.
* Get Apache to propertly work with POST, and some SAPI fixes
1999-05-28 22:41:48 +00:00
Andrey Hristov 3fe94e5b37 -Modified PCRE library slightly to do what needs to be done
-Updated preg_replace() code to handle stuff properly
-Removed ability to specify external PCRE library source to link against
(since our bundled version is patched now)
1999-05-28 20:54:52 +00:00
Andrey Hristov a5138d2724 We don't need those there. 1999-05-27 14:02:29 +00:00
Andrey Hristov e10e4dbe10 Really fix the configuration now so that it's possible to compile both
against the bundled PCRE library and the one external to the source tree.
Crossing my fingers while Zeev compiles this. :)
1999-05-27 13:59:39 +00:00
Sascha Schumann 5d0a7599a9 - fix CGI build (at least) 1999-05-27 01:34:18 +00:00
Zeev Suraski 36947fc45a Fix pcre build 1999-05-27 01:19:00 +00:00
Andrey Hristov 66f850e5b7 -Added PCRE library source
-Updated configuration process
1999-05-26 21:47:57 +00:00
Andrey Hristov d73c638526 Added preg_split. Same syntax as regular split(). 1999-05-26 18:59:04 +00:00
Andrey Hristov 0062ae6218 A few changes here.
First of all, as per extensive discussion on the list, the functions are now
prefixed with "preg" instead of "pcre".

Secondly, global matching is now possible using preg_match_all.  Please, give
suggestions on a better name if this one doesn't sit well with you.  Possible
names are preg_global_match and preg_gmatch.

preg_match_all takes 4 arguments: a regex pattern, a subject string,
the array for capturing subpatterns, and a parameter that tells how the results
in the subpatterns array are arranged.

Basically, preg_match_all will go through the subject string and try to capture
all the matches that it finds, not just the first one like preg_match.

4th parameter can be PREG_PATTERN_ORDER (default) or PREG_SET_ORDER.

Example:
preg_match_all("|</?([^>]+)>|", "<div align=left>a test</div>", $out, PREG_PATTERN_ORDER);

This returns results so that $out[0] is an array of full pattern matches, $out[1] is an array
of first captured subpattern matches, and so on.

$out[0] -> ("<div align=left>", "</div>")
$out[1] -> ("div align=left", "div")

Example:
preg_match_all("|</?([^>]+)>|", "<div align=left>a test</div>", $out, PREG_SET_ORDER);

This returns results so that $out[0] is an array of first full pattern match and subpatterns,
$out[1] is an array of second full pattern match and subpatterns.

$out[0] -> ("<div align=left>", "div align=left")
$out[1] -> ("</div>", "div")

If anyone has a better name for these PREG_ constants and also which one should be the default,
I'd like to hear it.
1999-05-26 15:22:02 +00:00
Andrey Hristov 57b22c8b64 Some comments. 1999-05-22 19:46:27 +00:00
Andrey Hristov 912f17d278 Added ability to pass array parameters to pcre_replace. 1999-05-22 19:14:57 +00:00
Andrey Hristov e3a70c1f04 -Added regex cache
-Made module thread-safe
1999-05-21 19:27:44 +00:00