Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'escape': 0.07; 'function,': 0.07; 'subject:characters': 0.09; 'subject:string': 0.09; 'received:dip.t-dialin.net': 0.16; 'received:t-dialin.net': 0.16; 'string': 0.17; 'wrote:': 0.17; 'trying': 0.21; 'seems': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'lines': 0.28; 'code': 0.31; 'to:addr:python-list': 0.33; 'pm,': 0.35; 'but': 0.36; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'your': 0.60; 'containing': 0.61; 'received:93': 0.72 Date: Tue, 09 Oct 2012 16:10:40 +0200 From: Agon Hajdari User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: string contains and special characters References: In-Reply-To: X-Enigmail-Version: 1.4.4 Content-Type: text/plain; charset=ISO-8859-1 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: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1349792373 news.xs4all.nl 6919 [2001:888:2000:d::a6]:44626 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31026 On 10/09/2012 04:02 PM, loial wrote: > I am trying to match a string that containing the "<" and ">" characters, using the string contains function, but it never seems to find the lines containing the string > > e.g if mystring.contains("") : > > Do I need to escape the characters...and if so how? > if '' in yourstring: # your code -- Agon Hajdari