in reply to avoiding a particular character or set of characters
I'm sure there is a shorter version and I want to see that, saints :)while ( $javacode =~ s{ (/\*\* .*? \*/) }{ <!--REPLACED_COMMENT--> }xm +s ){ push @comments, $1; } my @lines = (); LINE: foreach my $line (split "\n", $javacode) { push @lines, $line; next LINE if $line =~ m { \A \s* // }xms; # change lines $lines[-1] =~ ... } $javacode = join "\n", @lines; my $comment_id = 0; $javacode =~ s{<!--REPLACED_COMMENT-->}{$comment[$comment_id++]}eg;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: avoiding a particular character or set of characters
by neeha (Novice) on Mar 27, 2006 at 15:20 UTC | |
by prasadbabu (Prior) on Mar 27, 2006 at 15:31 UTC | |
by neeha (Novice) on Mar 27, 2006 at 15:27 UTC |