perl5ever has asked for the wisdom of the Perl Monks concerning the following question:
and you want to put something just before the </body> tag. What's a good way to write the regular expression so that perl will start searching from the end of the string?my $x = ("x" x 100_000)."</body></html>";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Optimizing a regex that replaces near the end of a string
by shmem (Chancellor) on Mar 18, 2009 at 20:57 UTC | |
|
Re: Optimizing a regex that replaces near the end of a string
by almut (Canon) on Mar 18, 2009 at 20:48 UTC | |
|
Re: Optimizing a regex that replaces near the end of a string
by thunders (Priest) on Mar 18, 2009 at 21:31 UTC | |
|
Re: Optimizing a regex that replaces near the end of a string
by thunders (Priest) on Mar 18, 2009 at 22:55 UTC | |
|
Re: Optimizing a regex that replaces near the end of a string
by moritz (Cardinal) on Mar 18, 2009 at 23:28 UTC | |
|
Re: Optimizing a regex that replaces near the end of a string
by JavaFan (Canon) on Mar 19, 2009 at 10:25 UTC |