I've got Regex targeting alpha-numeric strings that are product numbers (all will be CAP/number combinations of various lengths) wrapping these product numbers in bold tags for hundreds of generated HTML emails.
This worked great to bold product numbers, but also captures random parts of URLs and hex colors in my HTML email's tags attributes.
I've tried to exclude hex colors, and only include text after ">" and before "<". These don't seem to omit certain URLs and hex colors. Example...from this regex and replace syntax:
var newHtml = html.replace(new RegExp(/([0-9][^ ]*[A-Z][^ ]*)|([A-Z]
[^ ]*[0-9][^ ]*)(?=[^<|<|http|#]*(>|>|$))/g),"
<strong>$1</strong>");
and this text, from which I only want to wrap 09D623 that appears outside of tags:
Lorem ipsum <a href="http://www.example.com/09D623" target="blank"
style="color: #66BB12;">dolor sit</a> amet, 09D623 non pulvinar nunc
egestas. Nunc sit amet imperdiet 09D623 magnat.
I still capture 66BB12, a hex color inside a tag along with extra characters following the color, and random URLs if they contain caps/numbers such as this example. I've tried to exclude hex color using this: ^(#[0-9a-f]{3}|[0-9a-f]{6})$ and separately, tag contents using either of these expressions: (?!([^<]+)?>) but none of these seems to work as expected and I'm not even sure I have the exclude expression correct (?!^ or (?!([^ tacked on after the expression that works (at the top, following new RegExp... Thanks for any insights you can share...test at https://regex101.com/r/rW6iL6/13 or, 
