so, if you've got a file, do something like:
while ($line = <FH> ) {
$line =~ m/^(.+)$/ig;
print "<s>$1<\/s>\n";
}
On Sun, Nov 14, 2010 at 1:53 PM, Uri Guttman <[email protected]> wrote:
> >>>>> "sw" == shawn wilson <[email protected]> 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 ------ [email protected] -------- http://www.sysarch.com--
> ----- Perl Code Review , Architecture, Development, Training, Support
> ------
> --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com---------
>