Proper escaping was done by using regex101's generate code function, this is also why # was swapped for / so the code can be copied directly in the future with out having to manually modify it.
Technically @include accepts arbitrary PHP, but this will at least give everyone a way to adjust things to something that works.
Fixes #26
The regex was not taking including data as a variable in to account, and there where also some minor errors in how the string was escaped.
The block for matching variable names was taken from here: https://www.php.net/language.variables.basics
Proper escaping was done by using regex101's generate code function, this is also why
#
was swapped for/
so the code can be copied directly in the future with out having to manually modify it.Technically
@include
accepts arbitrary PHP, but this will at least give everyone a way to adjust things to something that works.Example:
Can now be written as: