Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '(so': 0.07; 'subject:Question': 0.07; 'python': 0.09; 'parsers': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'looked': 0.10; 'aug': 0.13; 'sat,': 0.15; 'expressions.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.17; 'properties': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'in.': 0.27; 'skip:@ 10': 0.27; 'regular': 0.27; 'header:X-Complaints-To:1': 0.28; 'chris': 0.28; 'comparison': 0.29; 'words': 0.29; "i'm": 0.29; 'from:addr:yahoo.co.uk': 0.32; 'could': 0.32; 'to:addr:python- list': 0.33; 'hi,': 0.33; 'agree': 0.34; 'direction': 0.35; 'pm,': 0.35; 'received:org': 0.36; 'but': 0.36; 'totally': 0.36; 'subject:: ': 0.38; 'mark': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'fire': 0.62; 'more': 0.63; 'here': 0.65; 'internet': 0.71; 'frank': 0.75; 'examples.': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Regex Question Date: Sat, 18 Aug 2012 11:50:03 +0100 References: <385e732e-1c02-4dd0-ab12-b92890bbed66@o3g2000yqp.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-146-1-115.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: X-Antivirus: avast! (VPS 120818-0, 18/08/2012), Outbound message X-Antivirus-Status: Clean X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345286931 news.xs4all.nl 6945 [2001:888:2000:d::a6]:59224 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27290 On 18/08/2012 06:42, Chris Angelico wrote: > On Sat, Aug 18, 2012 at 2:41 PM, Frank Koshti wrote: >> Hi, >> >> I'm new to regular expressions. I want to be able to match for tokens >> with all their properties in the following examples. I would >> appreciate some direction on how to proceed. >> >> >>

@foo1

>>

@foo2()

>>

@foo3(anything could go here)

> > You can find regular expression primers all over the internet - fire > up your favorite search engine and type those three words in. But it > may be that what you want here is a more flexible parser; have you > looked at BeautifulSoup (so rich and green)? > > ChrisA > Totally agree with the sentiment. There's a comparison of python parsers here http://nedbatchelder.com/text/python-parsers.html -- Cheers. Mark Lawrence.