Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!xlned.com!feeder1.xlned.com!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.039 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; '(so': 0.07; 'subject:Question': 0.07; 'looked': 0.10; 'aug': 0.13; 'sat,': 0.15; 'expressions.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.17; 'received:209.85.214.174': 0.21; 'properties': 0.24; 'header:In- Reply-To:1': 0.25; 'in.': 0.27; 'skip:@ 10': 0.27; 'message- id:@mail.gmail.com': 0.27; 'regular': 0.27; 'words': 0.29; "i'm": 0.29; 'could': 0.32; 'to:addr:python-list': 0.33; 'hi,': 0.33; 'received:google.com': 0.34; 'direction': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=KCuP75cstkLWCPrkYIziHD7ro/EuQ24dQVXfP7aVxZc=; b=jTFj6fAIZqbKfUyDBBSDZmY6zRiZVuOF74PC6yHFOhK1ezM1AdgOv1UGH8DHPl4Y2W ffA7CNy8T8pWKitMC2LTwv6lLAIYnfY4goE+IRyB33o5+mF2Wz2oq0HpgEEfg4ONVUj1 0keupQAPPuN/JU0TlO2rG51RcXoCgy023OWCiX1UcIxQgSAeKeh2uuz0KCVPrvOq336V tvgXbMhJvO3HvQ11zVggRn+wb0D7BeI+oOIS49/y4rT74cf127vxwfCNZPBFP7DhU0Zq UIAkhpDy/3vG8VAsi+YfSwp2l1VqC2WYrvF3pqOs7RCME4eJCnOxNr0o+162ozjPAFpU p9rg== MIME-Version: 1.0 In-Reply-To: <385e732e-1c02-4dd0-ab12-b92890bbed66@o3g2000yqp.googlegroups.com> References: <385e732e-1c02-4dd0-ab12-b92890bbed66@o3g2000yqp.googlegroups.com> Date: Sat, 18 Aug 2012 15:42:26 +1000 Subject: Re: Regex Question From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345268549 news.xs4all.nl 6915 [2001:888:2000:d::a6]:58296 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27284 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