]> granicus.if.org Git - onig/commitdiff
update doc/RE for absent group
authorK.Kosako <kosako@sofnec.co.jp>
Fri, 14 Jul 2017 06:37:38 +0000 (15:37 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Fri, 14 Jul 2017 06:37:38 +0000 (15:37 +0900)
doc/RE
doc/RE.ja

diff --git a/doc/RE b/doc/RE
index 354d7cdef356ac730e44c3d03d98691ce3afa5df..c899dbdb9ad31c6ad11fc1daaf873757b92b6028 100644 (file)
--- a/doc/RE
+++ b/doc/RE
@@ -1,4 +1,4 @@
-Oniguruma Regular Expressions Version 6.5.0    2017/07/13
+Oniguruma Regular Expressions Version 6.5.0    2017/07/14
 
 syntax: ONIG_SYNTAX_RUBY (default)
 
@@ -240,6 +240,19 @@ syntax: ONIG_SYNTAX_RUBY (default)
 
                      Assigning the same name to two or more subexps is allowed.
 
+  (?~absent_exp)     Absent group    (* proposed by Tanaka Akira)
+                     This works like ".*", but it is limited by the range that
+                     does not include the string match with absent_exp.
+                     ".*" is used as a default generator.
+                     Therefore this is affected by the multi-line option (?m).
+
+  (?~|generator|absent_exp)   Absent group with custom generator  (* original)
+                              Generator must be a greedy or possessive quantifier.
+
+                              ex. (?~|\d*|345)
+                                  (?~|(?:abc|de|f){0,100}|def)
+
+
   (?(condition_exp)then_exp|else_exp)    if-then-else
   (?(condition_exp)then_exp)             if-then
 
index d908e1000fd6987beba852432001c6d450990631..61630fef992288bf653c00bfff7786a0c579d95d 100644 (file)
--- a/doc/RE.ja
+++ b/doc/RE.ja
@@ -1,4 +1,4 @@
-鬼車 正規表現 Version 6.5.0    2017/07/13
+鬼車 正規表現 Version 6.5.0    2017/07/14
 
 使用文法: ONIG_SYNTAX_RUBY (既定値)
 
                     この場合には、この名前を使用した後方参照は可能であるが、
                     部分式呼出しはできない。
 
+  (?~不在式)        不在式集合     (* 原案 田中哲)
+                    これは".*"のように動作するが、absent_expに適合する文字列を
+                    含まない範囲に制限される。
+                    ".*"が既定の生成子として使用される。
+                    そのため、マルチラインオプション(?m)の影響を受ける。
+
+                    不在式が長さ0でマッチングする可能性があれば、常に失敗する。
+                    (返せる文字列範囲が存在しないので、これは正当な動作である)
+
+  (?~|生成子|不在式)    生成子付き不在式集合  (* 原作)
+                        生成子は貪欲あるいは強欲な量指定子でなければならない。
+
+                        例. (?~|\d*|345)
+                            (?~|(?:abc|de|f){2,100}|def)
+
+                        * 量指定子の最低回数が0より大きい場合は、都合により生成される
+                          バイトコードが非効率なものにならざるを得ないので、
+                          0にすることを勧める。
+
   (?(条件式)成功式|失敗式)    条件式が成功すれば成功式、失敗すれば失敗式を実行する
                              この機能の存在理由は、成功式が失敗しても失敗式には
                              行かないこと。これは他の正規表現で書くことができない。