Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Michael Torrie Newsgroups: comp.lang.python Subject: Re: Regular expressions Date: Tue, 03 Nov 2015 20:47:18 -0700 Lines: 19 Message-ID: References: <662g3blobme52hfoududj27err185v2npm@4ax.com> <56397a18$0$11094$c3e8da3@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de KXRAU4HeIezB0k12r1khXwoDCGn9CwKBHI9QOtDNx7kw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'default.': 0.07; 'expressions': 0.07; 'grep': 0.09; 'indicates': 0.09; '"grep': 0.16; 'expressions.': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'magic': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'say.': 0.16; 'subject:Regular': 0.16; 'subject:expressions': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'header:In-Reply-To:1': 0.24; "i've": 0.25; 'header:User-Agent:1': 0.26; 'used,': 0.27; 'least': 0.27; 'gnu': 0.27; 'regular': 0.29; 'about.': 0.29; "i'm": 0.30; 'certainly': 0.30; 'michael': 0.33; "d'aprano": 0.33; 'stands': 0.33; 'steven': 0.33; 'message- id:@gmail.com': 0.34; 'something': 0.35; 'but': 0.36; '(and': 0.36; 'mode': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'mean': 0.38; 'takes': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'default': 0.61; 'charset:windows-1252': 0.62; 'more': 0.63; 'times': 0.63; 'course.': 0.67; 'night': 0.67; 'talking': 0.67; 'special': 0.73 X-Virus-Scanned: amavisd-new at torriefamily.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <56397a18$0$11094$c3e8da3@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:98206 On 11/03/2015 08:23 PM, Steven D'Aprano wrote: >>> Grep can use regular expressions (and I do so with it regularly), but >>> it's default mode is certainly not regular expressions ... >> >> Its very name indicates that its default mode most certainly is regular >> expressions. > > I don't even know what grep stands for. > > But I think what Michael may mean is that if you "grep foo", no regex magic > takes place since "foo" contains no metacharacters. More likely I just don't know what I'm talking about. I must have been thinking about something else (shell globbing perhaps). Certainly most of the times I've seen grep used, it's to look for a word with no special metacharacters, as you say. Still a valid RE of course. But I have learned to night I don't need to resort to grep -e to use regular expressions. At least with GNU grep, that's the default.