diff NEWS @ 14536:6d5c951ec520

Add 'emptymatch', 'noemptymatch' options to regular expressions. * NEWS: Announce new options. * liboctave/regexp.cc (regexp::match): Add processing option for zero length matches. * liboctave/regexp.h (class opts): Add emptymatch option to constructors, setter/getter routines, private variable. * DLD-FUNCTIONS/regexp.cc (parse_options): Add emptymatch to options parsing routine. * DLD-FUNCTIONS/regexp.cc (octregexp): Ignore emptymatch when determing output ordering of arguments. * DLD-FUNCTIONS/regexp.cc (Fregexp): Add new options to docstring. Add %!tests for new behavior. * DLD-FUNCTIONS/regexp.cc (Fregexprep): Add %!tests for new behavior.
author Rik <octave@nomad.inbox5.com>
date Sat, 07 Apr 2012 09:43:53 -0700
parents ad2ff36996b8
children e47d929fde8f
line wrap: on
line diff
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,18 @@
 Summary of important user-visible changes for version 3.8:
 ---------------------------------------------------------
 
+ ** 'emptymatch', 'noemptymatch' options added to regular expressions.
+
+    With this addition Octave now accepts the entire set of Matlab options
+    for regular expressions.  'noemptymatch' is the default, but 'emptymatch'
+    has certain uses where you need to match an assertion rather than actual
+    characters.  For example, 
+
+    regexprep ('World', '^', 'Hello ', 'emptymatch')
+      => Hello World
+
+    where the pattern is actually the assertion '^' or start-of-line.
+
  ** Redundant terminal comma accepted by parser
 
     A redundant terminal comma is now accepted in matrix