/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "apr.h"
#include "apr_lib.h"
#include "apr_pools.h"
#include "apr_strings.h"
#include "ap_config.h"
#include "ap_regex.h"
#include "httpd.h"
{
return APR_SUCCESS;
}
const char *pattern)
{
/* perl style patterns
* add support for more as and when wanted
*/
/* allow any nonalnum delimiter as first or second char.
* If we ever use this with non-string pattern we'll need an extra check
*/
const char *endp = 0;
const char *rxstr;
char delim = 0;
if (!apr_isalnum(pattern[0])) {
}
action = SUBSTITUTE;
str += 2;
}
str += 2;
}
/* FIXME: fix these simplminded delims */
/* we think there's a delimiter. Allow for it not to be if unmatched */
if (delim) {
}
if (!endp) { /* there's no delim or flags */
return ret;
}
else {
return NULL;
}
}
/* We have a delimiter. Use it to extract the regexp */
/* If it's a substitution, we need the replacement string
* TODO: possible future enhancement - support other parsing
* in the replacement string.
*/
if (action == SUBSTITUTE) {
/* missing replacement string is an error */
return NULL;
}
}
/* anything after the current delimiter is flags */
while (*++endp) {
switch (*endp) {
default: break; /* we should probably be stricter here */
}
}
}
else {
return NULL;
}
/* count size of memory required, starting at 1 for the whole-match
* Simpleminded should be fine 'cos regcomp already checked syntax
*/
while (*rxstr) {
switch (*rxstr++) {
case '\\': /* next char is escaped - skip it */
if (*rxstr != 0) {
++rxstr;
}
break;
case '(': /* unescaped bracket implies memory */
break;
default:
break;
}
}
}
return ret;
}
const char *pattern, char **newpattern)
{
const char *remainder;
char *subs;
/* snrf process_regexp from mod_headers */
return 0; /* no match, nothing to do */
}
if (!*newpattern) {
return 0; /* FIXME - should we do more to handle error? */
}
/* recurse to do any further matches */
if (ret > 1) {
/* a further substitution happened */
}
}
*newpattern = subs;
}
return ret;
}
#ifdef DOXYGEN
{
}
#endif
* rx->match is a pointer and it's your responsibility to ensure
* it hasn't gone out-of-scope since the last ap_rxplus_exec
*/
const char **match)
{
if (n >= 0 && n < ap_rxplus_nmatch(rx)) {
}
else {
*len = -1;
}
}
{
int len;
const char *match;
}