I'm trying to write a function that matches an array of strings to a string of HTML code. It would then place a bold and /bold around the match. Now if I were matching the strings to regular text, the function would be something like:
function boldText(matches, text)
{
var pattern = new RegExp(matches.join("|"),"g");
text.replace(pattern,"<b>"+__what to write here?__+ "</b>"
}
However, since it's an HTML file, I don't want to bold anything that's between a less-than-sign and a greater-than-sign. Only stuff outside of HTML tags should be bolded. What might that regular expression be?
To reiterate, I'm looking for a regular expression that matches if-and-only-if the match isn't between a 'less-than-sign'+ any number of characters and any number of characters + a "greater-than-sign"
Ugh, nobody is answering me :(