Skip to main content

Regular Expressions (legacy document)

Regular Expressions can be used as criteria for filter if you do text searching. The match of the text and the regular expression will be proved.

With Regular Expressions you can for example search for words that begin with "s" and end with "d", without defining the letters between.

Don't be put off because it may look confusing and difficult on the first view.

Just read every point step by step. It could be useful to do step by step what is explained here, parallel in the online- testing website.

1. Requirements

All the Regular Expressions have to be in #.

(There are other boundary signs, but in the following examples and all the Solutions we will concentrate on limiting with #.)

e03d576d7633479dee18fb0cf1a252c1.png

This function will find: Sneaker

Examples - frequently used functions

2. Text Search

e59879b4d67228de6a06e1701607a643.png

This expression searches if there is a 1 or 2 or 3 or 4 or 5 or 6 in the text.

you can also write that shorter, it means the same !

4302e0f8cfc805c56b6562629f726782.png
eb66b7a53405943e520acb44692f90b5.png

This expression will search for all the letters between a and z (ä,ö,ü,ß are not included).

If you want to include ä,ö,ü, ß, you have to write it like this:

5b4736fd1aa136c3aabb7dfce06c70ac.png
b0251bd529bbb92b8ae69456926af583.png

This function searches for: "color:" , color can contain every letter from a-z and äüöß, but no number.

The plus means that the letters after "color:" can appear once or more.

For example in the word "red", there are 3 appears, so the plus is essential.

If you want to skip a letter or a number you can write:

dcde8691b4e67ac60af47e0f8a881ded.png

This expression will search all the numbers from 1 to 3 and from 5 to 6, so we skip number 4.

3. Usage of Special Signs

()

7b3eb93990feb3ef829b254fa71300ff.png

The round brackets we use to summarize longer expressions together as one element.

So if we relate on the previous element, the whole expression inside the brackets is meant.

?

9eb0bf049df567c8d8fb08f3bc509a64.png

The question mark says: the previous element can appear but not has to appear.

So it will be found following expression combinations: Sneaker Boots, Boots, Sneaker

+

68ed595dbae17eb74a9077098699c99c.png

The plus means that that the previous element can appear once or more.

That means nothing else but that it is a word. Without the plus we would search just for ONE letter from a-z, which makes no sense normally.

.

742563a4629982bdaef454633c8b763a.png

The point stands for any single sign.

Because of the plus this optional signs can appear once or more.

This expression will find all the words in the text that start with an "M" and end with "er", no matter how many letters are between.

For example the names: Müller, Mayer, Meyer, Maier, Möllerunger,...

*

6d71c258c2b7acf3e518755694ecd301.png

The * means: the previous element can appear Once/ Several times, or NOT. So it can appear, but not has to. It can also be a " "(space) in there.

The * means just the element directly previous "SXLM", "size:" has to appear!

So it could be found: "size: XS", "size: S", "size: " , "size: XXXXL"

fcbc0be5d8b2d5e04b439a4dea49e546.png

This function searches for: "color:",after "color:" can be a word with all letters from a-z, without äüöß, the letters can appear more than once.

It also searches for "size:", that consists of the letters S,X,L,M, which can appear several times or not.

^

This is your Example - Text: "- this is a description - and here it goes on"

You just want to edit the first dash "-" , you have to use following expression:

f973030458695c4f65e04bb56ebe2671.png
062340bf1a0c5f835631e576403d32bb.png

In the second case the sign ^ is outside of the brackets, that means:the regular expression/ searching string starts with optional numbers from 0-9 and it has to appear at least one of the sings.

The first number/digit will be deleted, all the others not.

Text before: "97 cm size"

Text after: "cm size"

...and if now the ^ is inside the brackets:

d9b908be0b0c8ca911c0d6b35047b673.png

That means: The expression we search for must not include the numbers from 0-9.

--> That means, we are searching for everything, except a number, and delete it.

Text before: "97 cm size"

Text after: "97"

|

This sign finds the expressions that appear before and after it.

Example: #this|that# finds "this" and "that".

73bea38afe5618f51f694b9d6d42a5ad.png

This expression is useful, if you have one word, written in two different ways.

Because the option with .+ gives you everything, no matter what is between.

This option just searches for: "Müller" and "Maier".

****

This slash means: The previous element is no function.

Example: + means: This + is to take as an arithmetic operator to calculate.

Don't confound the normal slash / with  

i

If you write an i after your Expression, you ignore capitalization.

c53d5fbd39de503ad0f44ffe0e722bdd.png

This function will find the words Müller, Mayer, müller, mayer, MAIER, MinisteR,...

U

The letter U, attached to the function in #, tells the system to find the expression that appears first in the text. the second will stay uncared.

f950163ee6e666cb0727e1253208efd6.png

Ui

You can combine the letters attaches to the expression.

ae6fae25cb839305cc968cd3bf86bd09.png

This function will search for the word Sneaker, no matter if it is written capitalized or not (because of the i): SNEAKER, Sneaker, sneakER,...

And it will just find the word that appears first in the text (because of the U).

Problems

If the Regular Expression you made doesn't work, the mistake can come from the special signs.

Just one little point can make your searching- task searching in the wrong way.

4. Useful links

Training - here you can practise online, and see the results directly (Site in German).

Hereare all functions listed and explained, available in many languages.

For more functions click here(Site in German), this is a very easy explained site with practical examples.

For a video- tutorial on youtube.de which explains quick and easy more functions - click here(also in German).