Thanks for the report. The version you are using is grep-5.2.1. Many bugs related to the -o option have been fixed in the latest release grep-5.2.3.
I have tried a few cases and they all worked as expected: -- % ./grep --version GNU grep 2.5.3 Copyright (C) 1988, 1992-2002, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. % echo 'abc1234abc' | ./grep '[1234567890]*' abc1234abc % echo 'abc1234abc' | ./grep -o '[1234567890]*' 1234 -- Note that under most shells you should use quotes around the pattern if you specify *, otherwise the * is interpreted by the shell. For example: -- % echo 'abc1234abc' | ./grep -o [1234567890]* tcsh: ./grep: No match. -- Cheers, TAA ----------------------------------------------------- Tony Abou-Assaleh Email: [EMAIL PROTECTED] Web site: http://tony.abou-assaleh.net ----------------------[THE END]---------------------- On Fri, 28 Sep 2007, [EMAIL PROTECTED] wrote: > When trying to match a repeated character class, the match works when > using grep with no arguments, but the match fails when using -o (show > only the matching pattern). I've attached grepbug-cli.txt, which > demonstrates the bug, and the input file I used, > grepbug-onlymatching.txt. I even tried throwing on perl support with > -P, because I know character classes are defined in this way with Perl > regular expressions. Also, adding quotes around the match pattern > makes no difference. > > Thanks. >