From: merlyn at stonehenge.com (Randal L. Schwartz)
Date: 29 Apr 1999 07:26:22 -0700
Subject: converting perl to python - simple questions.
References: <000101be8f62$b66e4700$669e2299@tim>
Message-ID: <m1hfpzmrjl.fsf@halfdome.holdit.com>
X-UID: 1190                                                  

>>>>> "Tim" == Tim Peters <tim_one at email.msn.com> writes:

Tim> Perl actually has the same problem, but it's *usually* hidden by "regexp
Tim> context"; e.g.;

Tim>     $string =~ /\bthe/

Tim> matches "the" starting at a word boundary, while

Tim>     $pattern = "\bthe";
Tim>     $string =~ /$pattern/

Tim> matches "the" following a backspace character.

Oddly enough, these *will* match word boundaries:

	$pattern = '\bthe';

	$pattern = qr/\bthe/;

Yes, Perl is heavily context sensitive... and so are human beings. :)

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn at stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn at teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me




