I have the following text...
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras lorem lacus, euismod ac convallis quis, adipiscing ut dui.
[preformatted #1]This is preformatted text I do not want to alter[/preformatted]
Ut porttitor Nunc urna dolor, porttitor vitae placerat sed, iaculis ut nibh. Etiam dignissim, nisl[preformatted #2]This is preformatted text I do not want to alter[/preformatted]
commodo pulvinar facilisis, eros enim volutpat ante, sed feugiat risus justo vitae ipsum. Duis lobortis hendrerit orci, non semper dolor porta sed.
What I'm trying to achieve is to replace all these preformatted blocks with temporary placeholder text such as [placeholder1]
, [placeholder2]
and store the original blocks in an indexed array of some sort so the placeholders can be swapped back out for the originals after I have carried out some external processing on the block.
I would be extremely grateful if somebody could point me in the correct direction. Thanks in advance.