XF 2.2 REGEX for template modifications

Nicolas FR

Well-known member
Hello,
In order to make template modifications more secure or universal I guess REGEXes are more suitable than simple replacements which can be disturbed by other modifications from different addons. Am I right ?

Unfortunately I totally discover this syntax and am quite unable to use it for example in 2 concrete cases that I currently encounter.

In PAGE_CONTAINER template i want to add code before this part
HTML:
        <div class="p-footer-row">
            <xf:if contentcheck="true">
                <div class="p-footer-row-main">
                    <ul class="p-footer-linkList">
And add code after this part
HTML:
                <xf:copyright />
                {{ phrase('extra_copyright') }}
            </xf:contentcheck>
            </div>
        </xf:if>

What REGEX replacement could I use?
Thanks for your help on this.
 
I would like to add something before and after <head> whatever </head>

I tried to use #(<head>*</head>)#si

Then

Code:
stuff to insert
$1
more stuff

But it doesn't match anything.
 
Top Bottom