Skip to content

Latest commit

 

History

History
50 lines (31 loc) · 1.14 KB

README.md

File metadata and controls

50 lines (31 loc) · 1.14 KB

Craft-TwigPCRE

Twig PCRE Filters for Craft CMS

##Filters:

See also: PHP PCRE-Functions

##Examples:

Basics:

|preg_filter(pattern, replacement, limit)

|preg_grep(pattern)

|preg_match(pattern)

|preg_quote(delimiter)

|preg_replace(pattern, replacement, limit)

|preg_split(pattern)

Please read the php docs for a more detailed explanation of all functions.

Usage:

{{ "This is a simple example."|preg_replace('/simple/', 'beautiful') }}

will output: This is a beautiful example.

##Install:

  1. Move the twigpcre directory into the craft/plugins/ directory.
  2. Go to Settings -> Plugins and enable 'Twig PCRE Filters'.