Start with your significant character - release $ , since its ASCII 36:
++++++[->++++++<]>
Read the input by copying both the input and the significant character twice, with the second significant character at the end:
[[->+>>>>+<<<<<]>>,[->+>+<<]
for such a structure:
โโโโโฒโโโโโโโโฑโโโโโโโโฌโโโโโโโโโโโโโ
โ $ โ blank โ input โ input โ $ โ
โโโโโบโโโโโโโโนโโโโโโโโดโโโโโโโโโโโโโ
Subtract the first $ from the first input :
<[->>-<<]>>
If it is not equal to zero, move it three times to an empty cell after copying $ , then step back non-stop, exiting the loop when the input was $ and otherwise leave you at $ , ready to start:
[>>>]<]
After the loop, you remain on the blank matching character. Move forward to the corresponding input character and erase it so that it is not reprinted, move back five times to get an intact copy of the second and last input and save a backup from there (this should not rely on transfer interpreters and, for example, if you shift forward a little at the beginning):
>>[-]<<<<<[<<<<<]
And then print them out!
>>>>>[.>>>>>]
Generally,
++++++[->++++++<]> [[->+>>>>+<<<<<]>>,[->+>+<<]<[->>-<<]>>[>>>]<] >>[-]<<<<<[<<<<<]>>>>>[.>>>>>]
source share