I have the following string , s1
, as a part of a longer text (which doesn't have the following patter in it i.e. this pattern only happens once through out the text. The text also includes white spaces and new lines)
<!-- COMPONENTS_LIST_START -->
* [line-vis](line-chart)
* [trend-vis](trend-vis)
<!-- COMPONENTS_LIST_END -->
I want to replace it with the following string , s2
:
<!-- COMPONENTS_LIST_START -->
* [line-vis](line-chart)
* [trend-vis](trend-vis)
* [common-vis](common-vis)
<!-- COMPONENTS_LIST_END -->
I use the following RegEx but it doesn't match it :
str1.replace(/<!-- COMPONENTS_LIST_START -->(\s|.)*<!-- COMPONENTS_LIST_END -->/, str2)
Doesn't this : (\s|.)*
mean , all characters including white space characters ?