Skip to end of metadata
Go to start of metadata

Difficulty MODERATE

About Regex:

A regular expression, regex or regexp (sometimes called a rational expression) is a sequence of characters that define a search pattern. Usually this pattern is used by string searching algorithms for "find" or "find and replace" operations on strings, or for input validation.

Wikipedia

Please see the Regex Wikipedia link for full description: https://en.wikipedia.org/wiki/Regular_expression

Steps:

  1. First we need to import a set of images:

Fig. 1


The folder contains a set of 40 image files, please note the different filenames of the images that we are going to filter in this example.

Fig. 2

 

   2.  After we imported a set of images we go to the RegEx filter box (1) and insert our sorting expression.

Fig. 3

  3.  In order for the sorting to take effect press Reload Preview (2).


Final step after reloading the preview, the images files containing "AZ" filenames, using the expression *^AZ* should show in the thumbnails gallery:

Fig. 4

 

The following table contains a set of expressions or syntax that is used to sort your image files in the 360Creator software:

RegEx SyntaxExpected ResultExample of text entered in search boxExplanation
.Sorts all files.Inserting the .(dot) in the RegEx filter text-box will sort all of your files, this RegEx symbol can also be used when you want a normal sort of all your images.

\d

Single digits\dThis RegEx filter will sort images file names with single digits (0-9) and will not sort 10, 12, 123.png image files with more than 1 digit
^[first digit - last digit]{number of digits to include} Multiple digits

^[0-9]{2}

This RegEx syntax will sort filenames which start with minimum two digits, example: 00.png, 001.png or 0011.png
\sWhite space

\s

The \s character inserted in the RegEx text-box will sort all of your files that contain a white space, tab, etc. For example: My File01.png, My File02.png, MyFile03.png it will sort only the first two images containing white space

\s+Multiple white spaces
\s+ matches any whitespace character (equal to [\r\n\t\f\v])
+ Quantifier — Matches between one and unlimited times, as many times as possible, giving back as needed
The \s+ character inserted in the RegEx text-box will sort all of your files that contain a multiple white spaces. For example: File Name.png, File Name02.png, File Name03.png and so on.
[first digit - last digit] Sort between first and last digit

[1-9], [1-5], [0-9], etc.

If the user has 24 image files, with name from 1 to 24, inserting [1-5] in the RegEx filter text-box, will sort the images from 1 to 5, the rest on the 19 image files will not be sorted

^filenameMatches any string starting with 'filename'

^shoe (Default Case Sensitive)

(?i)^shoe (No Case Sensitive)

(?-i)^shoe (Case Sensitive)

  • Matches all filenames starting with shoe, this is case sensitive by default (e.g. shoe01.png, shoe02.png, etc), will not sort Shoe01.png, Shoe02.png, etc. Please notice capital S from Shoe!
  • Matches all filenames starting with shoe or Shoe, this is not case sensitive (e.g. shoe01.png, shoe02.png, etc), will also sort Shoe01.png, Shoe02.png, etc. Please notice capital S from Shoe!
  • Matches all filenames starting with shoe, this is case sensitive (e.g. shoe01.png, shoe02.png, etc), will not sort Shoe01.png, Shoe02.png, etc. Please notice capital S from Shoe!


filename$Ends with 'filename'

shoe.jpg$ (Default Case Sensitive)

(?i)shoe.jpg$ (No Case Sensitive)

(?-i)shoe.jpg$ (Case sensitive)


  • Matches all filenames which end with shoe, this is case sensitive by default (e.g. file-shoe.png, file-shoe.png, etc), will not sort Shoe01.png, Shoe02.png, etc. Please notice capital S from Shoe!
  • Matches all filenames starting with shoe, this is case sensitive(e.g. file-shoe.png, file-Shoe.png, etc), will not sort Shoe01.png, Shoe02.png, etc. Please notice capital S from Shoe!
  • Matches all filenames starting with shoe, this is case sensitive by default (e.g. shoe01.png, shoe02.png, etc), will not sort Shoe01.png, Shoe02.png, etc. Please notice capital S from Shoe!
^filename$Sorts the exact string 'filename'Normally this is not used because it will sort only 1 file which contains the exact string/word. You cannot have two or multiple files which contain the exact filenameExact file name images mobile.jpg, smartphone.jpg, etc. Inserting the symbols along with mobile: ^shoe$ will sort all of your files containing 'shoe' word
filenameContains 'filename'shoeThis pattern matches all filenames containing the exact word (e.g. shoe, glass, building, etc.)