1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

template modification regex with xenforo variables

Discussion in 'XenForo Development Discussions' started by tenants, May 17, 2015.

  1. tenants

    tenants Well-Known Member

    The part of template that I want to inject into contains a xenforo variable, in fact the only way to distingush it from other parts of the page is the variable

    I wanted to use regex (not simple replacement), since other add-on developers will use this template, and I don't want to write over what they have done / not find the area if they change it

    obviously this regex doesn't work because its looking for {$... and the raw data does not contain {$:
    #<dl[^>]*>[^<]*<dt[^>]*>[^<]*<div {$xenforoVariable}(.*?)</dl>#siu
    for the same reason even this regex will not work
    Is there a way of passing variables into the core tms regex?
  2. Chris D

    Chris D XenForo Developer Staff Member

    That should work fine but you need to escape the dollar so:

    tenants likes this.
  3. Chris D

    Chris D XenForo Developer Staff Member

    Side note: very good site for testing regex: https://regex101.com.

    It forces a delimiter of / so you have to remember to escape those too.
    batpool52!, tenants and HWS like this.
  4. tenants

    tenants Well-Known Member

    (y)(y)(y)(y) :)

    Thank you

Share This Page