Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'escape': 0.07; 'function,': 0.07; 'subject:characters': 0.09; 'subject:string': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'string': 0.17; 'wrote:': 0.17; 'trying': 0.21; 'cc:2**0': 0.23; 'seems': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'lines': 0.28; 'code': 0.31; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'october': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'received:209.85.214': 0.39; 'your': 0.60; 'containing': 0.61; 'received:209.85.214.184': 0.84; 'received:mail- ob0-f184.google.com': 0.84 Newsgroups: comp.lang.python Date: Tue, 9 Oct 2012 08:09:30 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=92.27.96.234; posting-account=ORTvxwoAAADiCmwF40GLsX3U6yAOA5M5 References: User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 92.27.96.234 MIME-Version: 1.0 Subject: Re: string contains and special characters From: loial To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: , Message-ID: Lines: 8 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1349795375 news.xs4all.nl 6864 [2001:888:2000:d::a6]:45831 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31036 On Tuesday, 9 October 2012 15:19:33 UTC+1, Agon Hajdari wrote: > 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 myst= ring.contains("") : > > Do I need to escape the characters...and if so= how? > if '' in yourstring: # your code -- Agon Hajdari That worked...thanks