I am using the replace method as follows:
<code v-html="'/<test>/'.replace(/(?:\r\n|\r|\n)/g, 'testing')"></code>
I have a larger string that I am testing against with many \n but I noticed with the above replace function to remove these characters, somehow the value <test> inside // gets replaced.
The /<test>/ string isn't turning into //, it's being rendered by the v-html directive. To more accurately test your replace method I'd recommend using the v-text directive instead.
Below is a demonstration of the difference in output between the two directives.
new Vue({
el:"#app"
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
<p>Using v-html</p>
<code v-html="'/<test>/'.replace(/(?:\r\n|\r|\n)/g, 'testing')"></code>
<br/>
<p>Using v-text</p>
<code v-text="'/<test>/'.replace(/(?:\r\n|\r|\n)/g, 'testing')"></code>
</div>