diff --git a/Wildcards-and-Matchers.md b/Wildcards-and-Matchers.md index e053214..ceb242f 100644 --- a/Wildcards-and-Matchers.md +++ b/Wildcards-and-Matchers.md @@ -1,16 +1,17 @@ -# NOTE: Some of the info in this article is coming in Mapbase v3.0 and does not reflect the current version of Mapbase. - -Think of it as a sneak peek which rewards people who follow this mod closely enough to find this article on the wiki. ## 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**. -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. +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, Mapbase adds support for this kind of expanded wildcard usage, allowing for a `*` to be placed at any point in the query. Because it only adds onto Source's linear comparison code, Mapbase does **NOT** add support for multiple wildcards, like `*_soldier*_manhack`. +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`. Mapbase also supports leaving text after this `?` wildcard, but it still does not support multiple. +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