summaryrefslogtreecommitdiff
path: root/bin/expr/expr.1
diff options
context:
space:
mode:
authorjtc <jtc@NetBSD.org>1993-10-04 22:06:59 +0000
committerjtc <jtc@NetBSD.org>1993-10-04 22:06:59 +0000
commit441c51a9d552fbe50a4a8b34864324f978e8a462 (patch)
tree09d529f339f0cb6da647ef661cdd778fd943ba40 /bin/expr/expr.1
parentd143e6f1752187377d29ea4d5187b09a1e875640 (diff)
Document the new, less restrictive, behavior of the matching operator.
Diffstat (limited to 'bin/expr/expr.1')
-rw-r--r--bin/expr/expr.118
1 files changed, 9 insertions, 9 deletions
diff --git a/bin/expr/expr.1 b/bin/expr/expr.1
index 8b6cfeed778..a592564f8dd 100644
--- a/bin/expr/expr.1
+++ b/bin/expr/expr.1
@@ -28,7 +28,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: expr.1,v 1.4 1993/08/28 04:21:00 jtc Exp $
+.\" $Id: expr.1,v 1.5 1993/10/04 22:06:59 jtc Exp $
.\"
.Dd July 3, 1993
.Dt EXPR 1
@@ -83,19 +83,19 @@ operator matches
against
.Ar expr2 ,
which must be a regular expression. The regular expression is anchored
-to the begining of the string with an invisible
-.Dq ^ ,
-therefore
-.Dq ^
-is not a special character.
+to the begining of the string with an implicit
+.Dq ^ .
.Pp
-If the pattern contains at lest one regular expression
-subexpression
+If the match succeeds and the pattern contains at least one regular
+expression subexpression
.Dq "\e(...\e)" ,
the string corresponding to
.Dq "\e1"
is returned;
otherwise the matching operator returns the number of characters matched.
+If the match fails and the pattern contains a regular expression subexpression
+the null string is returned;
+otherwise 0.
.El
.Pp
Parentheses are used for grouping in the usual manner.
@@ -117,7 +117,7 @@ The following example returns the number of characters in variable a.
The
.Nm expr
utility exits with one of the following values:
-.Bl -tag -width Ds
+.Bl -tag -width Ds -compact
.It 0
the expression is neither an empty string nor 0.
.It 1