Use js to highlight the keywords specified in the article content

Time:2022-1-2

[Ctrl + a full selection note: you need to refresh the page to import external JS]

Multi keyword


[Ctrl + a full selection note: you need to refresh the page to import external JS]

Copy codeThe code is as follows:
Character meaning
$$$(JScript 5.5 or later)
$& specifies the portion of string obj that matches the entire pattern. (JScript 5.5 or later)
$` specifies the “stringobj” part before the match described by $&. (JScript 5.5 or later)
$’specifies the string obj section after the match described by $&. (JScript 5.5 or later)
$n , the nth , sub match captured, where , n , is the decimal single digit from 1 to 9. (JScript 5.5 or later)
$NN , the , th sub match captured, where , NN , is a decimal two digit number from 01 to 99. (JScript 5.5 or later)
g. Global pattern matching
i. Case insensitive matching

Multi keyword, a good method, I also use it


[Ctrl + a full selection note: you need to refresh the page to import external JS]

Why should we be limited to the replacement of HTML? Isn’t it more convenient to start with text objects?


[Ctrl + a full selection note: you need to refresh the page to import external JS]


[Ctrl + a full selection note: you need to refresh the page to import external JS]

Recommended Today

Crash tracking journey of IOS development (I)

Preface: Recently, I encountered a crash blood disaster caused by crash in daily development. In a release in early May, the crash rate of the app developed by the author was directly increased from one thousand to nearly two thousand. At that time, the project leader just needed to report the relevant situation of project […]