sl5net / SL5_preg_contentFinder

a PHP Template Engine class using Perl Compatible Regular Expressions (PCRE)

Home Page:https://github.com/sl5net/SL5_preg_contentFinder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SL5_preg_contentFinder

a PHP Template Engine class using Perl Compatible Regular Expressions (PCRE)

See complete examples inside example folder or inside the test folder. :)

Example source conversion :

a{b{B}}

==>

a[b[B]]

Example source conversion :

if(X1){$X1;if(X2){$X2;}}

==>

if(X1)[
..$X1;if(X2)[
....$X2;
..]
]

HowTo config conversion for this last example:

$old_open = '{'; $old_close = '}'; $new_open_default = '['; $new_close_default = ']'; $charSpace = "."; $newline = "\r\n"; $indentSize = 2;

now simply start conversion. BTW optional you could use regular expressions and much more. or you could use your own callback function. enjoy :)

try regular expressions online. for example here: https://regex101.com/


Example source conversion :

a{b{B}}

==>

a
1|[
1:..b
2|..[
2:....B
2:..]
1:]

About

a PHP Template Engine class using Perl Compatible Regular Expressions (PCRE)

https://github.com/sl5net/SL5_preg_contentFinder

License:GNU Affero General Public License v3.0


Languages

Language:PHP 100.0%