suaveant has asked for the wisdom of the Perl Monks concerning the following question:
best example... say I have a simple template, and I replace a template item with text that has more template data in it, is there a way to make the regexp go back and continue from the spot it replaced at. This is more of a curiosity than anything else, there are certainly other ways to do it (like translating the text returned by do_something before it is returned...) but I would like to know. Obviously there is a danger of continuous looping if you could do this...1 while(s/(pattern)/&do_something($1)/ge);
- Ant
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: replacing text you have already replaced...
by merlyn (Sage) on Jul 25, 2001 at 18:04 UTC | |
|
Re: replacing text you have already replaced...
by wine (Scribe) on Jul 24, 2001 at 22:13 UTC | |
by suaveant (Parson) on Jul 24, 2001 at 22:24 UTC | |
by Hofmator (Curate) on Jul 25, 2001 at 14:30 UTC | |
by Hofmator (Curate) on Jul 25, 2001 at 13:51 UTC | |
by wine (Scribe) on Jul 25, 2001 at 14:00 UTC |