I'm sorry to say this, but this is a classic reason why there are posting guidelines at the top of this forum, and why they specifically ask for real examples and not made up ones.
Having got that off my chest, how about:
(?<!<[^<>]*)\b(inside)\b(?![^<>]*>)
with a replacement string of (say)
<b>$1</b>
which will turn your 'real' example from
<tag attr="this is inside">this is not inside</tag>
into
<tag attr="this is inside">this is not <b>inside</b></tag>
I have used the 'ignore case' option. Obviously you can choose whatever word you want to look for - I have arbitrarily chosen "inside" for this example. By the way, this may not work for all regex engines as it uses a variable length look-behind, and I don't know if Javascript will allow this.
One other thing about terminology: from what I understand, a 'back reference' occurs within the pattern such as "<(\w+)>(.*?)</\1>" which will find the opening and corresponding closing tag, whatever the tag name happens to be. What you are using here is a match group reference within the replace text.
However, I would also suggest that you look at using the HTML/XML DOM for this type of thing - it will automatically separate text that is inside a tag from that which is outside, and will allow you to manipulate the text more easily.
Susan