Community Patterns

Community Library Entry

0

Regular Expression
Created·2022-10-03 16:29
Flavor·ECMAScript (JavaScript)

/
(?<=<!-- Template Nav Start -->[\n])([\n\s\S]*?)(?=[\s\n]*?<!-- Template Nav End -->)
/
gm
Open regex in editor

Description

Used with Visual Studio Code to search and replace text in between two markers. I use this to template in things that occur on multiple pages like the navigation menu. I know this can be done with javascript or servers side scripting, but sometimes I just want to pre process all of this like in the old Dreamweaver days:-)

Submitted by Bishop