On Sun, Nov 14, 2010 at 1:53 PM, Uri Guttman <u...@stemsystems.com> wrote:
> >>>>> "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: > > yep, got confused with sed.... > 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--------- >