On 6/7/05, Chris Devers wrote:
> 
> Which matches a dot /./ -- which is a metacharacter meaning "matches
> anything at all" 

Not quite correct - a dot (".") matches "any single character", not
"anything at all", and even this rule has an exception - a dot will
not match a newline ("\n") unless you use the "s" modifier.

> 
> In other words, it will turn this string --
> 
>     abc
> 
> -- into this
> 
>     officers-gasenate.htmlofficers-gasenate.htmlofficers-gasenate.html
> 

No, it will turn "abc" into:
       officers-gasenate.htmlbc
Unless you use the "g" modifier.

> 
> Thus, the regex should be something like this:
>     
> s|\./officers-gasenate\.html|http://www\.legis\.state\.ga\.us/cgi-bin/peo_list\.pl\?List=stsenatedl|
> 

There's no need to escape metachars in the replacement part. Without
modifiers (such as "e" or "x") the replacement part is treated as a
simple double-quoted string (delimiter dependent).
So the s/// can be written as:
s|\./officers-gasenate\.html|http://www.legis.state.ga.us/cgi-bin/peo_list.pl?List=stsenatedl|

Cheers,
-- 
Offer Kaye

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to