1
0
mirror of https://github.com/apache/httpd.git synced 2025-04-18 22:24:07 +03:00

25 Commits

Author SHA1 Message Date
Yann Ylavic
97a1873332 regex: Add AP_REG_NOTEMPTY_ATSTART maching option.
* include/ap_mmn.h:
  Bump MMN minor.

* include/ap_regex.h:
  Define AP_REG_NOTEMPTY_ATSTART bit.

* server/util_pcre.c(ap_regexec_ex):
  Map AP_REG_NOTEMPTY_ATSTART to native PCRE_NOTEMPTY_ATSTART.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1915268 13f79535-47bb-0310-9956-ffa450edef68
2024-01-16 16:56:58 +00:00
Yann Ylavic
e52a206008 regex: Add ap_regexec_ex() which can take a starting offset to match from.
* include/ap_mmn.h:
  Bump MMN minor.

* include/ap_regex.h:
  Declare ap_regexec_ex().

* server/util_pcre.c(ap_regexec, ap_regexec_len, ap_regexec_ex):
  Reuse existing ap_regexec_len() code to implement ap_regexec_ex() where the
  offset is given instead of zero, then implement ap_regexec{,len}() in terms
  of ap_regexec_ex().



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1915267 13f79535-47bb-0310-9956-ffa450edef68
2024-01-16 16:51:03 +00:00
Yann Ylavic
c8f486d716 Follow up to r1873941: define AP_REG_NO_DEFAULT for raw ap_regcomp() usage.
This avoids having to define AP_REG_NO_* for each APR_REG_* specific option,
thus replacing AP_REG_NO_DOTALL introduced lately.

For ap_rxplus_compile() and mod_substitute where default AP_REG_DOTALL is not
suitable, let's use:
    AP_REG_NO_DEFAULT | ap_regcomp_get_default_cflags() & AP_REG_DOLLAR_ENDONLY
to keep the default AP_REG_DOLLAR_ENDONLY unless RegexDefaultOptions unsets it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874090 13f79535-47bb-0310-9956-ffa450edef68
2020-02-16 23:08:32 +00:00
Eric Covener
b6dd2f55dc don't use DOTALL from mod_substitute which leaves \n at the end of the line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873941 13f79535-47bb-0310-9956-ffa450edef68
2020-02-12 13:36:40 +00:00
Eric Covener
81313af01a factor out default regex flags
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873747 13f79535-47bb-0310-9956-ffa450edef68
2020-02-07 17:08:41 +00:00
William A. Rowe Jr
d771a84dbf Correctly identify origin of util_pcre.c/ap_regex.h as pcreposix[.ch]
and correct LICENSE/NOTICE to match.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824973 13f79535-47bb-0310-9956-ffa450edef68
2018-02-21 14:56:01 +00:00
Yann Ylavic
2c21956d95 regex: Allow to configure global/default options for regexes.
Like caseless matching or extended format, which may be useful as default
behaviour the whole configuration.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1824339 13f79535-47bb-0310-9956-ffa450edef68
2018-02-15 17:53:24 +00:00
Yann Ylavic
08ddf7ad0a ap_expr: open string expressions to the <word>.
Introduces the syntax "%{:<word>:}", borrowed from the <var>'s one, and which
likewise can be embedded anywhere in a string expression (the same reserved
character ':' gets reused in an unambiguous manner).

This allows the two types of expressions (boolean and string) to now share
fully the same language set, namely: strings, lists, vars, regexes, backrefs,
functions with multiple or complex arguments, and especially combinations
thereof.

Most of them were reserved to boolean expressions only, while complex string
constructions can also benefit to, well, strings. The <word> construct allows
that (say the syntax "%{:<word>:}" looks like a temporary variable constructed
in a string).

Since string expressions may now have to deal with lists (arrays), they also
need a way to produce/extract strings from list and vice versa. This can be
done with the new "join" and "split" operators, while the new substitution
regexes (like "s/<pattern>/<substitute>/<flags>") may be used to manipulate
strings in place. All this of course available for both string and boolean
expressions.

Tests and doc updates upcoming..



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1810605 13f79535-47bb-0310-9956-ffa450edef68
2017-10-02 21:57:26 +00:00
Rainer Jung
1aa6158bda Forgotten file needed for r1612934.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612940 13f79535-47bb-0310-9956-ffa450edef68
2014-07-23 20:27:32 +00:00
Christophe Jaillet
147c51bdba Doxygen fix + alignment + typo
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1598207 13f79535-47bb-0310-9956-ffa450edef68
2014-05-29 06:20:36 +00:00
Jeff Trawick
3508158873 doxygen improvements
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1560482 13f79535-47bb-0310-9956-ffa450edef68
2014-01-22 19:15:14 +00:00
Graham Leggett
4fecd089c4 Add a "MATCH_" prefix to variables set within
LocationMatch/DirectoryMatch/FilesMatch.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1555266 13f79535-47bb-0310-9956-ffa450edef68
2014-01-03 22:26:55 +00:00
Graham Leggett
43e022f007 core: Support named groups and backreferences within the LocationMatch,
DirectoryMatch, FilesMatch and ProxyMatch directives.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1554300 13f79535-47bb-0310-9956-ffa450edef68
2013-12-30 19:50:52 +00:00
Rainer Jung
0415804814 BZ 52623: Fix building against PCRE 8.30.
PCRE dropped support for pcre_info() which is
deprecated since a long time. Use pcre_fullinfo()
instead, which exists since version 3.0 of PCRE.

Patch provided by Ruediger Pluem.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1243176 13f79535-47bb-0310-9956-ffa450edef68
2012-02-11 22:45:37 +00:00
Jim Jagielski
103f776c25 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174748 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:38:09 +00:00
Stefan Fritsch
63366c900b Add ap_regexec_len() function that works with non-null-terminated
strings.

PR: 51231
Submitted by: Yehezkel Horowitz <horowity checkpoint com>, Stefan Fritsch


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1125802 13f79535-47bb-0310-9956-ffa450edef68
2011-05-21 20:34:05 +00:00
Nick Kew
d4963eadb1 Introduce ap_rxplus class: higher-level regexps supporting perl-style
regexp operations.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@999533 13f79535-47bb-0310-9956-ffa450edef68
2010-09-21 18:42:20 +00:00
Nick Kew
a66f25dc13 Fix to apidoc comments in ap_regex
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@997560 13f79535-47bb-0310-9956-ffa450edef68
2010-09-16 01:44:09 +00:00
Daniel Earl Poirier
04fd4abf90 Fix a lot of doxygen warnings. Thanks to Brad Hards for the patch.
I added a few more fixes, and there are still more that might
need a doxygen expert.

PR: 48061
Submitted by: Brad Hards
Reviewed by: poirier


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@830527 13f79535-47bb-0310-9956-ffa450edef68
2009-10-28 13:25:49 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Ian Holsman
8c1e315d3f Doxygen fixup / cleanup
submited by: Neale Ranns neale ranns.org
reviewed by: Ian Holsman



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@263931 13f79535-47bb-0310-9956-ffa450edef68
2005-08-28 23:03:59 +00:00
William A. Rowe Jr
e681eb22c8 Get httpd-2.1 building once again on win32.
NEVER NEVER screw around with redeclaring AP_ macros and constants.
  If the compiler won't pick them up, e.g., AP_DECLARE, ya've done 
  something wrong from the start.

  All httpd/ap headers depend on httpd.h - plain and simple, so this
  un-convolutes the unusual order here.

  STATIC has become PCRE_STATIC, along with some other odd definitions.
  The only remaining emit is that _pcre_free export is imported, which
  implies something is unusual with the declaration.  Still researching.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@154207 13f79535-47bb-0310-9956-ffa450edef68
2005-02-17 23:45:16 +00:00
Joe Orton
27759dec9a * include/ap_regex.h: Include apr.h not stdlib.h; replace pointless
regoff_t typedef with int; s/size_t/apr_size_t/;.  Comment fixes.

* server/util_pcre.c: s/size_t/apr_size_t/.

* include/httpd.h: Include stdlib.h here instead since many other
files assume it was included by httpd.h at some point.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153407 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 14:57:34 +00:00
Joe Orton
a0570c8746 Move the POSIX reg* implementations into the ap_* namespace;
internalise the ap_reg*<->PCRE wrapper:

* configure.in: Add srclib/pcre to the include path.

* include/ap_regex.h: Renamed from include/pcreposix.h.  Prefix all
constants with AP_; prefix all functions and types with ap_.  Define
AP_DECLARE to nothing if necessary.  Remove regcomp error codes.

* include/httpd.h: Include ap_regex.h not pcreposix.h.
(ap_pregcomp, ap_regexec, ap_regfree): s/regex_t/ap_regex_t/.
(ap_regexec, ap_regerror): Prototypes moved to ap_regex.h.

* server/util.c (regex_cleanup, ap_pregcomp, ap_pregsub, ap_pregfree):
Adjust for ap_ prefixed types.  (ap_regexec, ap_regerror): Removed.

* server/Makefile.in: Build util_pcre.c.

* server/util_pcre.c: Copied from srclib/pcre/pcreposix.c; remove use
of PCRE-internals to do error mapping; rename types to add AP_/ap_
prefixes as above.  Use APR includes.  (ap_regerror): Use apr_snprintf.

* srclib/pcre/Makefile.in: Don't build pcreposix.c into libpcre.la.

* modules/*: Update to use new type and constant names.

PR: 27750 (part one)
Submitted by: Andres Salomon <dilinger voxel.net>, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@153384 13f79535-47bb-0310-9956-ffa450edef68
2005-02-11 12:00:41 +00:00