Wiki source code of RegEx

Last modified by Asbjørn Ulsberg on 2018/09/06 14:42
Hide last authors
Asbjørn Ulsberg 1.1 1 {{velocity}}
2 #set ($content = $doc.getContent())
3 #set ($pattern = $regextool.compile('\(%\s+class="jumbotron"\s+%\)\s+\(\(\(\s+\(%\s+class="container"\s+%\)\s+\(\(\(\s+(.+)\s+\)\)\)\s+\)\)\)'))
4 #set ($matcher = $pattern.matcher($content))
5 #if ($matcher.find())
Asbjørn Ulsberg 2.1 6 $matcher.group(1)
Asbjørn Ulsberg 1.1 7 #else
Asbjørn Ulsberg 2.1 8 No match!
Asbjørn Ulsberg 1.1 9 #end
10 {{/velocity}}
11
12 (% class="jumbotron" %)
13 (((
14 (% class="container" %)
15 (((
16 ... Content here ...
17 )))
18 )))