> You don't say how these sections of text are demarked, but > assuming the matching requirements for the start and end of > the demarked sections are reasonable, you can do what you > need much more simply.
[applause] Brilliant, and exactly what I was asking for; unfortunately, it showed me that I was asking for the wrong thing. :\ Not horribly wrong, just a little off - but there's too much interaction between the results of this routine and the rest of the 'cleanup' routine to separate the two like this. What ends up happening when I try to use it this way is that the sub sees each chunk of data as a stand-alone piece and wraps paragraph markers around it - which results in the 'raw' piece always being a separate paragraph. So, it seems that this bit of processing has to remain part of the 'cleanup' routine itself - that is, I need to extract those pieces, mangle the main body, stick those pieces back in, and then finish paragraphing everything.
Darn it. Well, the intent was good, anyway - and thanks to all you wizards, I've learned something. Thank you!
Incidentally, I had to modify your regex a bit so it would get rid of the tags themselves:
my $raw_start = '[RAW]'; my $raw_stop = '[/RAW]'; $body =~ s[(?:^|\Q$raw_stop\E)(.+?)(?:\Q$raw_start\E|$)]{ my $toModify = $1; $toModify = cleanup($toModify); $toModify; }seg;
In reply to Re^2: Anchors, bleh :(
by oko1
in thread Anchors, bleh :(
by oko1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |