bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

regular expression behaviour.


From: cristi
Subject: regular expression behaviour.
Date: Wed, 03 Sep 2008 14:25:19 +0200
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)

Hello all,

By executing the following statement at the command prompt (linux os)

$ echo "         01" | grep '^ *...$'

the string  "         01" (excluding the double quotes)  is printed to
the standard output.  Can somebody  explain the behaviour? Of  course,
theoretically the regular expression matches the string, but according
to the documentation  it shouldn't. The documentation says  that the *
operator  is greedy  so the  regular expression  should match  all the
space at the beginnign of the  string and then (because of the 3 dots)
it should try to match 3 more characters.

regards
cristian zoicas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]