]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3170] Updated doc and ChangeLog
authorFrancis Dupont <fdupont@isc.org>
Sat, 8 Jun 2024 17:05:03 +0000 (19:05 +0200)
committerFrancis Dupont <fdupont@isc.org>
Tue, 11 Jun 2024 14:33:29 +0000 (16:33 +0200)
ChangeLog
doc/sphinx/arm/classify.rst

index 3e8b1068738b418fafedfa2807d1bdd42b32924d..85efeb9519043d2cc2272d74c17a2c8e0d1070ee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2253.  [func]          fdupont
+       Added the predicate token "match" which evaluates regular
+       expression matching.
+       (Gitlab #3170)
+
 2252.  [bug]           fdupont
        Corrected an issue in kea-dhcp6 which caused reserved prefixes
        to not be removed when their host reservation was deleted by
index 94be28f5a27f0e15ffc9fa21001745832f5f1ff7..c620d22633b2c685957d2d4a8f9d70ee245adda8 100644 (file)
@@ -474,6 +474,10 @@ Notes:
    |                       |                         | values and return     |
    |                       |                         | ``true`` or ``false`` |
    +-----------------------+-------------------------+-----------------------+
+   | Match                 | match('foo.*', 'foobar')| Match a regular       |
+   |                       |                         | expression with a     |
+   |                       |                         | value.                |
+   +-----------------------+-------------------------+-----------------------+
    | Not                   | not ('foo' == 'bar')    | Logical negation      |
    +-----------------------+-------------------------+-----------------------+
    | And                   | ('foo' == 'bar') and    | Logical and           |
@@ -563,6 +567,27 @@ addresses. The ``Int8ToText`` and ``UInt8ToText`` tokens expect 1 byte, the ``In
 ``UInt16ToText`` tokens expect 2 bytes, and ``Int32ToText`` and ``UInt32ToText`` expect 4 bytes.
 For all conversion tokens, if the data length is 0, the result string is empty.
 
+Predicates
+----------
+
+The two predicates are Equal and Match. They can be used to build other
+common predicates, for instance:
+::
+           not (substring('foobar', 3, 3) == 'bar')
+           match('foo.*', lcase('FooBar'))
+           match('.*foo.*', 'is it foo or bar')
+           match('^.*foo.*$', 'is it foo or bar')
+
+So inequality, case insensitive pattern matching or pattern search.
+
+.. note::
+
+   Detected invalid regular expressions are considered as syntax errors,
+   runtime exceptions during match are handled as no match.
+   Be careful with the match operator as it can show extremely bad
+   performance leading to regular expression denial of service (ReDoS).
+
+
 Logical Operators
 -----------------