On Wed, 4 Nov 2015 07:57 pm, Peter Otten wrote: > I tried Tim's example > > $ seq 5 | grep '1*' > 1 > 2 > 3 > 4 > 5 > $
I don't understand this. What on earth is grep matching? How does "4" match "1*"? > which surprised me because I remembered that there usually weren't any > matching lines when I invoked grep instead of egrep by mistake. So I tried > another one > > $ seq 5 | grep '[1-3]+' > $ > > and then headed for the man page. Apparently there is a subset called > "basic regular expressions": > > """ > Basic vs Extended Regular Expressions > In basic regular expressions the meta-characters ?, +, {, |, (, > and ) lose their special meaning; instead use the backslashed > versions \?, \+, \{, \|, \(, and \). > """ None of this appears relevant, as the metacharacter * is not listed. So what's going on? -- Steven -- https://mail.python.org/mailman/listinfo/python-list