.SH REWRITING
A string is rewritten according to a set of rules, called a `rewrite
context'.
-The rules are based on Regular Expressions (POSIX regex) with
-substring matching; basic variable substitution and map resolution
+The rules are based on POSIX (''extended'') regular expressions (regex)
+with substring matching; basic variable substitution and map resolution
of substrings is allowed by specific mechanisms detailed in the following.
The behavior of pattern matching/substitution can be altered by a set
of flags.
honors case in matching (default is case insensitive)
.TP
.B `R'
-use POSIX Basic Regular Expressions (default is Extended)
+use POSIX ''basic'' regular expressions (default is ''extended'')
.TP
.B `M{n}'
allow no more than
More flags (mainly Action Flags) will be added as needed.
.SH "Pattern matching:"
See
-.BR regex (7).
+.BR regex (7)
+and/or
+.BR re_format (7).
.SH "Substitution Pattern Syntax:"
Everything starting with `%' requires substitution;
.LP
the only obvious exception is `%%', which is left as is;
.LP
the basic substitution is `%d', where `d' is a digit;
-0 means the whole string, while 1-9 is a submatch, as discussed in
-.BR regex (7);
+0 means the whole string, while 1-9 is a submatch;
.LP
a `%' followed by a `{' invokes an advanced substitution.
The pattern is:
Substitution escaping has been delegated to the `%' symbol,
which is used instead of `\e' in string substitution patterns
because `\e' is already escaped by slapd's low level parsing routines;
-as a consequence,
-.BR regex (7)
-escaping requires two `\e' symbols, e.g. `\fB.*\e.foo\e.bar\fP' must
-be written as `\fB.*\e\e.foo\e\e.bar\fP'.
+as a consequence, regex escaping requires two `\e' symbols,
+e.g. `\fB.*\e.foo\e.bar\fP' must be written as `\fB.*\e\e.foo\e\e.bar\fP'.
.\"
.\" The symbol can be altered at will by redefining the related macro in
.\" "rewrite-int.h".
.BR slapd\-ldap (5),
.BR slapo\-pcache (5),
.BR slapd (8),
-.BR regex (7).
+.BR regex (7),
+.BR re_format (7).
.SH AUTHOR
Pierangelo Masarati, based on back-ldap by Howard Chu
.BR regex ,
then
.B <dnpattern>
-is a regular expression pattern,
+is a POSIX (''extended'') regular expression pattern,
as detailed in
-.BR regex (7),
+.BR regex (7)
+and/or
+.BR re_format (7),
matching a normalized string representation of the entry's DN.
-The regex form of the pattern does not (yet) support UTF-8.
+The regex form of the pattern does not (yet) support UTF\-8.
.LP
The statement
.B filter=<ldapfilter>
.B <style>
is
.BR regex ,
-the provided value is used as a regular expression pattern.
-If the attribute has DN syntax, the value
+the provided value is used as a POSIX (''extended'') regular
+expression pattern. If the attribute has DN syntax, the value
.B <style>
can be any of
.BR base ,
.B <group>
will be expanded as a replacement string (but not as a regular expression)
according to
-.BR regex (7),
+.BR regex (7)
+and/or
+.BR re_format (7),
and
.BR exact ,
which means that exact match will be used.
If the style of the DN portion of the
.B <what>
clause is regex, the submatches are made available according to
-.BR regex (7);
+.BR regex (7)
+and/or
+.BR re_format (7);
other styles provide limited submatches as discussed above about
the DN form of the
.B <by>
.B regex
style, which implies submatch
.B expand
-and
-.BR regex (7)
-match of the corresponding connection parameters.
+and regex match of the corresponding connection parameters.
The
.B exact
style of the
.SH SEE ALSO
.BR slapd (8),
.BR slapacl (8),
+.BR regex (7),
+.BR re_format (7)
.LP
"OpenLDAP Administrator's Guide" (http://www.OpenLDAP.org/doc/admin/)
.SH ACKNOWLEDGEMENTS
.I <pattern>
to be normalized according to the DN normalization rules, or the special
.I regex
-style, which causes
+style, which causes the
.I <pattern>
-to be compiled according to
-.BR regex (7).
+to be treated as a POSIX (''extended'') regular expression, as
+discussed in
+.BR regex (7)
+and/or
+.BR re_format (7).
A pattern of
.I *
means any non-anonymous DN.
.RE
This name is then compared against the
.B match
-regular expression, and if the match is successful, the name is
-replaced with the
+POSIX (''extended'') regular expression, and if the match is successful,
+the name is replaced with the
.B replace
string. If there are wildcard strings in the
.B match
.BR children ,
to allow any level of depth match, not including the exact match;
.BR regex
-explicitly requires the (default) match based on regular expression
-pattern, as detailed in
-.BR regex (7).
+explicitly requires the (default) match based on POSIX (''extended'')
+regular expression pattern.
Finally,
.B anonymous
matches unbound operations; the
.BR slapd\-ldap (5),
.BR slapd\-meta (5),
.BR slapd\-sql (5),
-.BR slapd (8),
-.BR regex (7).
+.BR slapd (8).
.SH AUTHOR
Originally implemented by Apurva Kumar as an extension to back-meta;
turned into an overlay by Howard Chu.
.SH REWRITING
A string is rewritten according to a set of rules, called a `rewrite
context'.
-The rules are based on Regular Expressions (POSIX regex) with
+The rules are based on POSIX (''extended'') regular expressions with
substring matching; basic variable substitution and map resolution
of substrings is allowed by specific mechanisms detailed in the following.
The behavior of pattern matching/substitution can be altered by a set
honors case in matching (default is case insensitive)
.TP
.B `R'
-use POSIX Basic Regular Expressions (default is Extended)
+use POSIX ''basic'' regular expressions (default is ''extended'')
.TP
.B `M{n}'
allow no more than
More flags (mainly Action Flags) will be added as needed.
.SH "Pattern Matching"
See
-.BR regex (7).
+.BR regex (7)
+and/or
+.BR re_format (7).
.SH "Substitution Pattern Syntax"
Everything starting with `$' requires substitution;
.LP
.LP
the basic substitution is `$<d>', where `<d>' is a digit;
0 means the whole string, while 1-9 is a submatch, as discussed in
-.BR regex (7);
+.BR regex (7)
+and/or
+.BR re_format (7).
.LP
a `$' followed by a `{' invokes an advanced substitution.
The pattern is:
Substitution escaping has been delegated to the `$' symbol,
which is used instead of `\e' in string substitution patterns
because `\e' is already escaped by slapd's low level parsing routines;
-as a consequence,
-.BR regex (7)
-escaping requires two `\e' symbols, e.g. `\fB.*\e.foo\e.bar\fP' must
+as a consequence, regex escaping requires
+two `\e' symbols, e.g. `\fB.*\e.foo\e.bar\fP' must
be written as `\fB.*\e\e.foo\e\e.bar\fP'.
.\"
.\" The symbol can be altered at will by redefining the related macro in
.BR slapd\-meta (5),
.BR slapd\-relay (5),
.BR slapd (8),
-.BR regex (7).
+.BR regex (7),
+.BR re_format (7).
.SH AUTHOR
Pierangelo Masarati; based on back-ldap rewrite/remap features
by Howard Chu, Pierangelo Masarati.