Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Tim Chase Newsgroups: comp.lang.python Subject: Re: Regular expressions Date: Wed, 4 Nov 2015 09:42:16 -0600 Lines: 19 Message-ID: References: <662g3blobme52hfoududj27err185v2npm@4ax.com> <56397a18$0$11094$c3e8da3@news.astraweb.com> <56397FC6.9040700@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1YGeojnecLhkK5R8U/e6TAUsj+TmqsAmlmYaeMVISmiw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'default.': 0.07; 'expressions': 0.07; 'grep': 0.09; 'res': 0.09; '"grep': 0.16; '-tkc': 0.16; 'flavors:': 0.16; 'frankly': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Regular': 0.16; 'subject:expressions': 0.16; 'switch.': 0.16; 'wrote:': 0.16; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'compatible': 0.27; 'regular': 0.29; 'command-line': 0.29; 'strings,': 0.29; 'fixed': 0.31; 'activate': 0.35; 'should': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'charset:us-ascii': 0.37; "didn't": 0.39; 'to:addr:python.org': 0.40; 'otten': 0.84; 'received:23': 0.84 X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-MC-Relay: Neutral X-MailChannels-SenderId: wwwh|x-authuser|tim@thechases.com X-MailChannels-Auth-Id: wwwh X-MC-Loop-Signature: 1446651822728:330764693 X-MC-Ingress-Time: 1446651822727 In-Reply-To: X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) Importance: low X-Priority: 4 (Low) X-AuthUser: tim@thechases.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:98233 On 2015-11-04 09:57, Peter Otten wrote: > Well, I didn't know that grep uses regular expressions by default. It doesn't help that grep(1) comes in multiple flavors: grep: should use BRE (Basic REs) fgrep: same as "grep -F"; uses fixed strings, no REs egrep: same as "grep -E"; uses ERE (Extended REs) grep -P: a GNUism to use PCREs (Perl Compatible REs) there's also an "rgrep" which is just "grep -r" which I find kinda silly/redundant. Though frankly I feel the same way about fgrep/egrep since they just activate a command-line switch. You get even crazier when you start adding zgrep/zegrep/zfgrep. -tkc