Re: Newbie backreference question
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: Newbie backreference question

From: Robert Kern <rkern@ucsd.edu>
Date: Thu Jun 30 2005 - 23:30:49 CEST

paulm wrote:
> Hi,
> In perl I can do something like:
>
> $a = 'test string';
> $a =~ /test (\w+)/;
> $b = $1;
> print $b . "\n";
>
> and my output would be "string".
>
> How might this snippet be written in python?

http://docs.python.org/lib/module-re.html

-- 
Robert Kern
rkern@ucsd.edu
"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter
Received on Thu Sep 29 16:40:37 2005