From a030c46acdb33e208049b8756cb85c076d997130 Mon Sep 17 00:00:00 2001 From: thex Date: Wed, 8 Jan 2020 14:34:02 +0100 Subject: [PATCH 1/4] added documentation for twig extensions preg_split / preg_match --- pages/03.themes/04.twig-filters-functions/docs.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pages/03.themes/04.twig-filters-functions/docs.md b/pages/03.themes/04.twig-filters-functions/docs.md index 2a91163c0..3faa4594c 100644 --- a/pages/03.themes/04.twig-filters-functions/docs.md +++ b/pages/03.themes/04.twig-filters-functions/docs.md @@ -252,6 +252,18 @@ Converts a string to the English plural version `'person'|pluralize` **{{ 'person'|pluralize }}** +[version=17] +#### Preg Split + +Wrapper for PHP [preg_split()](https://www.php.net/manual/en/function.preg-split.php) that splits a text by a pattern given as regular expression. +[/version] + +[version=17] +#### Preg Match + +Wrapper for PHP [preg_match()](https://www.php.net/manual/en/function.preg-match.php) that matches a text by a pattern given as expression pattern. Returns the matches if there is at least one or false if not. +[/version] + [version=16] #### Print Variable From 5668ea5afcc43628887b33214583a3e045f33796 Mon Sep 17 00:00:00 2001 From: thex Date: Wed, 8 Jan 2020 14:42:08 +0100 Subject: [PATCH 2/4] updated wording for preg_match twig extension description --- pages/03.themes/04.twig-filters-functions/docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/03.themes/04.twig-filters-functions/docs.md b/pages/03.themes/04.twig-filters-functions/docs.md index 3faa4594c..90cf43481 100644 --- a/pages/03.themes/04.twig-filters-functions/docs.md +++ b/pages/03.themes/04.twig-filters-functions/docs.md @@ -261,7 +261,7 @@ Wrapper for PHP [preg_split()](https://www.php.net/manual/en/function.preg-split [version=17] #### Preg Match -Wrapper for PHP [preg_match()](https://www.php.net/manual/en/function.preg-match.php) that matches a text by a pattern given as expression pattern. Returns the matches if there is at least one or false if not. +Wrapper for PHP [preg_match()](https://www.php.net/manual/en/function.preg-match.php) that matches a text by a pattern given as expression pattern. Returns the matche(s) if there is at least one accordance or `false` if not. [/version] [version=16] From 882f432d091ed0ebc20b0f571354c50ed3c92df4 Mon Sep 17 00:00:00 2001 From: thex Date: Wed, 8 Jan 2020 14:43:59 +0100 Subject: [PATCH 3/4] fixed alphabetic order of twig extensions (preg_match/preg_split) --- pages/03.themes/04.twig-filters-functions/docs.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/03.themes/04.twig-filters-functions/docs.md b/pages/03.themes/04.twig-filters-functions/docs.md index 90cf43481..26c984797 100644 --- a/pages/03.themes/04.twig-filters-functions/docs.md +++ b/pages/03.themes/04.twig-filters-functions/docs.md @@ -253,15 +253,15 @@ Converts a string to the English plural version `'person'|pluralize` **{{ 'person'|pluralize }}** [version=17] -#### Preg Split +#### Preg Match -Wrapper for PHP [preg_split()](https://www.php.net/manual/en/function.preg-split.php) that splits a text by a pattern given as regular expression. +Wrapper for PHP [preg_match()](https://www.php.net/manual/en/function.preg-match.php) that matches a text by a pattern given as expression pattern. Returns the matche(s) if there is at least one accordance or `false` if not. [/version] [version=17] -#### Preg Match +#### Preg Split -Wrapper for PHP [preg_match()](https://www.php.net/manual/en/function.preg-match.php) that matches a text by a pattern given as expression pattern. Returns the matche(s) if there is at least one accordance or `false` if not. +Wrapper for PHP [preg_split()](https://www.php.net/manual/en/function.preg-split.php) that splits a text by a pattern given as regular expression. [/version] [version=16] From 13ff4c07f0c3434bb10447c297e90a6575079482 Mon Sep 17 00:00:00 2001 From: thex Date: Wed, 8 Jan 2020 14:46:16 +0100 Subject: [PATCH 4/4] fixed preg_match twig extension description --- pages/03.themes/04.twig-filters-functions/docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/03.themes/04.twig-filters-functions/docs.md b/pages/03.themes/04.twig-filters-functions/docs.md index 26c984797..65d2c6ce3 100644 --- a/pages/03.themes/04.twig-filters-functions/docs.md +++ b/pages/03.themes/04.twig-filters-functions/docs.md @@ -255,7 +255,7 @@ Converts a string to the English plural version [version=17] #### Preg Match -Wrapper for PHP [preg_match()](https://www.php.net/manual/en/function.preg-match.php) that matches a text by a pattern given as expression pattern. Returns the matche(s) if there is at least one accordance or `false` if not. +Wrapper for PHP [preg_match()](https://www.php.net/manual/en/function.preg-match.php) that matches a text by a pattern given as regular expression. Returns the matche(s) if there is at least one accordance or `false` if not. [/version] [version=17]