How to find and replace a substring?
<p>For example I have such a string, in which I must find and replace multiple substrings, all of which start with <code>#</code>, contains 6 symbols, end with <code>'</code> and should not contain <code>)</code> ... what do you think would be the best way of achieving that?</p>

<p>Thanks!</p>

<p>Edit:
just one more thing I forgot, to make the replacement, I need that substring, i.e. it gets replaces by a string generated from the substring being replaced.</p>
