我不认为您可以在一个Regex表达式中完成此操作,但前提是您可以遍历它:
function checkscript() {
var content = document.regexForm.input.value;
//match any HTML tag (you could specify font)(not an opening tag)(lowercase)(uppercase)(not an opening tag)
while(content.match(/(]*?>)([^
{
content = content.replace(/(]*?>)([^
}
document.regexForm.output.value = content;
}
Word myWord
wordWord
Word word wordWord
这个:
Word myWord
wordWord
Word word wordWord
变成:
Word my: Word
word: Word
Word word word: Word