You can go to https://regex101.com/ and try it yourself. You can enter expressions on the left side. Enter the matched content of the test below. There is a detailed explanation on the right. In addition, the|sin this regular expression is wasteful. You only need to write/<(?:.)*?>/g. If there is no need to operate on the capturing group, there is no need for non-capturing group. necessary. It can be simplified to/<.*?>/g
What you have here is the replacement function, which replaces with empty spaces
You can go to https://regex101.com/ and try it yourself. You can enter expressions on the left side. Enter the matched content of the test below. There is a detailed explanation on the right.
In addition, the
|s
in this regular expression is wasteful. You only need to write/<(?:.)*?>/g
. If there is no need to operate on the capturing group, there is no need for non-capturing group. necessary. It can be simplified to/<.*?>/g