I'm going to go the easy route and not bother putting an OR inside the search. I'll just have two different searches for this. The first will be what I did, above, for non-self-terminated tags. This is the search string for the self-terminated tags:
Code:
(\b\w+?)(<[^/]+?/>)(\w+?\b)
The replacement string is the same for both cases:
@j.p.s moving the initial word fragment to after the tag uses the same search strings as above. The difference would be the replace string: