Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.191 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.63; '*S*': 0.01; 'andreas': 0.16; 'bye,': 0.16; 'subject:Regular': 0.16; 'url:re': 0.16; 'followed': 0.16; 'wrote:': 0.18; 'text,': 0.24; 'header:In-Reply-To:1': 0.27; 'option.': 0.31; 'url:2008': 0.31; 'regular': 0.32; 'url:python': 0.33; 'basic': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'charset:us-ascii': 0.36; 'url:org': 0.36; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'url:12': 0.39; 'to:addr:python.org': 0.39; 'expression': 0.60; 'url:3': 0.61; 'email addr:gmail.com': 0.63; '(hint:': 0.84; 'end.': 0.84; 'subject:Search': 0.84; 'want:': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=K/IY3A9RNHdNLSkUep/wtI2u05EqD9qEVh9GFQNNSec=; b=A6Aqc4is85HKVyHpX0TS0xaI5za22oik9nlSo10oTek8u0PeipCHKXelboGT7SqolP jYLp19QCBaeHBCwalQuhgEL5zgR67pDSbgNRAh5jvPoEoFYwIXKf26Q8OIcd/NSbn4Ki AdaH1HIbmHrQYgJt2rkeKNP+AcrIBw+RDumLVuO5a02eVyd+j3x4HWtGg3PJKPUAGdil EBzWVoTwsyrwJpkCCDH/DPFBjLkUbZwiRryLggXnmoPFUOXm2QhErvZlPCATPOFtomd9 Tz7hWyh1RbbyZXWxz6fj+AE/BVjzowXkej6r8rdiUYzFaaW8Fqx00kpGh7dRyJYndnPF QIDA== X-Received: by 10.14.7.133 with SMTP id 5mr8454421eep.115.1371308510318; Sat, 15 Jun 2013 08:01:50 -0700 (PDT) Date: Sat, 15 Jun 2013 17:01:47 +0200 From: Andreas Perstinger To: python-list@python.org Subject: Re: Pattern Search Regular Expression In-Reply-To: <5200649f-2b2f-4535-8016-a31369e6e348@googlegroups.com> References: <51bc3c4d$0$29997$c3e8da3$5496439d@news.astraweb.com> <5200649f-2b2f-4535-8016-a31369e6e348@googlegroups.com> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371308512 news.xs4all.nl 15948 [2001:888:2000:d::a6]:37551 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48306 subhabangalore@gmail.com wrote: >I know this solution but I want to have Regular Expression option. >Just learning. http://mattgemmell.com/2008/12/08/what-have-you-tried/ Just spell out what you want: A word at the beginning, followed by any text, followed by a word at the end. Now look up the basic regex metacharacters and try to come up with a solution (Hint: you will need groups) http://docs.python.org/3/howto/regex.html#regex-howto http://docs.python.org/3/library/re.html#regular-expression-syntax Bye, Andreas