Skip to content

Filtering Patterns

Ramil Valitov edited this page Feb 16, 2018 · 2 revisions

What is filtering?

One of the key features of the FolderEx is the filtering option. It allows to select only desired images from a specified folder. Such approach allows:

  • to store a full photo album in a single folder without splitting it into subfolders;
  • use the same folder as a content source for different widgets.

Filtering patterns

RegExp

The filtering pattern is used to match the desired files inside the folder. It allows to select only some files from the folder. The pattern is defined as a RegExp (Regular Expression) - a powerful tool for matching data. If a filtering pattern is not defined, then a standard pattern is used that matches to all files with the following extensions:

  • jpg
  • jpeg
  • gif
  • png

The RegExp must be in PHP-compatible format (PCRE), read more. It is recommended to validate the RegExp before you use it on your website, please have a look at this free online tool.

RegExp Examples

Below are some examples of the RegExp.

Description RegExp Pattern
Default pattern (any PNG, JPEG and GIF images) /.(jpg|jpeg|png|gif)$/i
PNG images only /.png$/i
JPEG images only /.(jpg|jpeg)$/i
Images that contain the word fire (case-insensitive) in their file name /fire[^/\]*.(jpg|jpeg|png|gif)$/i
Clone this wiki locally