Regular expressions

Find details on the regular expressions the FCS RetiCount Data Acquisition Module uses to filter files which should be used for the import.

You can use regular expressions to validate a sequence of characters to have a certain schema. You can also extract specific contents using groups. This functionality is used by the FCS RetiCount Data Acquisition Module to extract the plate, tube, and tag number from the file name.

Expression elements

Frequently used elements of regular expressions are:
Element Description Details

.

Character 'Point'

Represents almost any character.

\d

Symbol 'Backslash d'

Represents a single numeric character.

(…)

Pair of parenthesis

Creates a regular expression group to extract a character sequence.

[…]

Pair of brackets

Represents a list or range of characters which can occur alternatively. For example, [ABC] means that either the character A, B, or C is expected.

\.

Symbol 'Backslash Point'

Represents the character point. The backslash is used to escape the special status of the character point (look above).

{n}

Pair of curly brackets

The preceding character or character group are expected to occur n times. For example, [A]{2} means that the character sequence AA is expected.

\s

Symbol 'Backslash s'

Represents a white space.

\S

Symbol 'Backslash S'

Represents every character except white spaces.

*

Character 'Asterisk'

The preceding character or character group may or may not occur and can occur multiple times.

+

Character 'Plus'

The preceding character or character group may occur multiple times but at least once.

Note:
Regular expressions are case-sensitive.

Example

The following example is a valid regular expression that captures five groups:

(\d\d)_(.{7})\s(\d\d\d)\s(\S+)\s(.+)\.HST
Expression element Description

\d\d

First, it expects two ciphers. They are captured in group 1.

_

They are followed by a _ (underscore).

.{7}

Then, seven not otherwise specified characters are expected followed by a white space. The seven characters are captured in group 2.

\s

Following the white space three ciphers are expected.

\d\d\d

They are captured in group 3.

\s

After this a white space and at least one non-white space character are expected.

\S+

The non-white space characters are captured in group 4.

\s

The last group is expected as at least one character following a white space.

.+

The last group is expected as at least one character following a white space.

\.HST

The last characters have to be the character sequence .HST.

Example character sequence

12_abcdefg 345 hij klm.HST
The example character sequence is accepted by the shown regular expression. The five captured groups are as follows:

Group

Captured characters

1

12

2

abcdefg

3

345

4

hij

5

klm