]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/blobdiff - README
This is 0.08
[perl/modules/re-engine-Plugin.git] / README
diff --git a/README b/README
index 9da0ecf52406a10dfc133c87339060e5d39465a5..7ab77850665cef35661fba766b742adad4730be5 100644 (file)
--- a/README
+++ b/README
@@ -1,6 +1,9 @@
 NAME
     re::engine::Plugin - API to write custom regex engines
 
+VERSION
+    Version 0.08
+
 DESCRIPTION
     As of perl 5.9.5 it's possible to lexically replace perl's built-in
     regular expression engine with your own (see perlreapi and perlpragma).
@@ -113,6 +116,9 @@ CALLBACKS
     routine should return a true value if the match was successful, and a
     false one if it wasn't.
 
+    This callback can also be specified on an individual basis with the
+    "callbacks" method.
+
 METHODS
   str
         "str" ~~ /pattern/;
@@ -167,6 +173,31 @@ METHODS
     The length specified will be used as a a byte length (using SvPV), not a
     character length.
 
+  nparens
+  gofs
+  callbacks
+        # A dumb regexp engine that just tests string equality
+        use re::engine::Plugin comp => sub {
+            my ($re) = @_;
+
+            my $pat = $re->pattern;
+
+            $re->callbacks(
+                exec => sub {
+                    my ($re, $str) = @_;
+                    return $pat eq $str;
+                },
+            );
+        };
+
+    Takes a list of key-value pairs of names and subroutines, and replace
+    the callback currently attached to the regular expression for the type
+    given as the key by the code reference passed as the corresponding
+    value.
+
+    The only valid key is currently "exec". See "exec" for more details
+    about this callback.
+
   num_captures
         $re->num_captures(
             FETCH => sub {