You can organize a search in tables or select elements from the model based on numeric or text data.

The text can be compared by exact coincidence, partially or by the fragments that meet the condition.

It is convenient, for example, when you need to select lines with a word, for example, "wall" anywhere in the text.

Then for the selection we will set the string ".*wall.*".

Here .* means a key symbol repeated as many times as necessary. I.e. as many times before the fragment "wall" and as many times after.

But probably somewhere there is a word with a capital letter.

Then we write."*[CcCc]ircle.*". Or even someone wrote the letter 'C' from the Russian layout.

We can take this into account - ".*[CcCc]ircle.*".

In the code, you can specify the character ^ - the beginning of the text and $ - the end of the text.

REGEX encoding provides the widest possibilities for flexible sampling in various cases of processing text information during sampling, etc.

For example, this can be used in the selection of elements by class name, layer, ID, etc.


Example

Check for the presence of the text "substring1" or "substring2" anywhere in the text:

"(?:.*substring1*)|(?:.*substring2.*)"


Example 2

Select interior walls in the list No. 1, which have a building material no thinner than 250mm, with a name that contains:

...Brick... ceramic...

...brick ... 

ceramic... or .

..ceramic...Brick...

...ceramic...brick...


ac_request_special("load_elements_list", 1, "WallType", 2,

       "", "Cls", "Classification ARCHICAD", "INBRANCH", "Brick wall", "", "AND",

       "", "UPub", "Placement", "=", "Inside", "", "AND",

       "", "EP", "buildingMaterialName_thickness(\"(?:.*[Bb]rick.*ceram.*)|(?:.*ceram.*[Bb]rick.*)\")", ">=", 0.250, "", "");