Changes for page RegEx

Last modified by Asbjørn Ulsberg on 2018/09/06 14:42
From empty
To version 1.1
edited by Asbjørn Ulsberg
on 2018/09/06 14:41
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,0 +1,1 @@
1 +RegEx
Parent
... ... @@ -1,0 +1,1 @@
1 +Sandbox.WebHome
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.XWikiGuest
1 +xwiki:XWiki.aul
Default language
... ... @@ -1,0 +1,1 @@
1 +en
Tags
... ... @@ -1,0 +1,1 @@
1 +px-custom-page-content
Content
... ... @@ -1,0 +1,18 @@
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())
6 +<strong>$matcher.group(1)</strong>
7 +#else
8 +<strong>No match!</strong>
9 +#end
10 +{{/velocity}}
11 +
12 +(% class="jumbotron" %)
13 +(((
14 +(% class="container" %)
15 +(((
16 +... Content here ...
17 +)))
18 +)))