>>>>> "sw" == shawn wilson <ag4ve...@gmail.com> writes:

  sw> second, why not use a place holder like someone recommended yesterday?
  sw> something like:
  sw> s/^(.+)$/<s>\1<\/s>/g

what is a placeholder? nothing like that in regexes. what you have there
is a backreference and used in the wrong place. \1 is meant to be used
ONLY in the regex part, not the replacement section. use $1 to get
the first grabbed part when in the replacement part. your code will
generate warnings:

perl -wle '$x = "a" ; $x =~ s/(a)/\1\1/'
\1 better written as $1 at -e line 1.
\1 better written as $1 at -e line 1.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to