Skip to content

Wildcards and Matchers

Blixibon edited this page Feb 5, 2020 · 2 revisions

Wildcards

In Source, using * at the end of an entity search will match all entities with names starting with the text before the asterisk. For example, using soldier* will match entities with the names soldier, soldier1, soldier2_manhack, soldierman, etc. but not sold or soldarity. This feature is known as a wildcard.

By itself, Source does not actually support "true" wildcards as seen in things like file lookup systems. It only supports trailing *. This means you can't use *_soldier or soldier*_manhack like you could in other software.

However, as of v3.0, Mapbase adds support for this kind of expanded wildcard usage, allowing for a * to be placed at any point in the query. It also switches to a recursive matching system, which allows for multiple wildcards, like s*ier*_man*.

Mapbase also adds support for ?, a different type of wildcard that can only subtitute for one character, unlike *, which can substitute for any number of characters. This means soldier? will match soldier1, soldier2, etc. but not soldier1_manhack. Multiple ? wildcards can be placed at any point in the text, allowing for queries like sol???r.

Regex

As of v3.0, Mapbase now supports regular expressions using the regex functions in the std library from C++ 11. They are prefixed with @/, but they are not suffixed by anything.

Matchers

Some logic entities use Response System matchers now.

Clone this wiki locally