Searching with Regular Expressions and Wildcards
Introduction
The Power Search Bar is an indispensable tool that enables users to locate source text and translations through the application of regular expressions and wildcards. While this feature offers a robust and flexible search experience, it's crucial to be aware that not all operators are supported. Refer to this documentation for a list of supported operators and examples of their usage.
Regular Expressions (Regex)
Regular expressions utilize placeholder characters, referred to as operators, to match patterns within data and text. Wordbee’s library supports all Unicode characters but reserves some of them to be regex operators:
" . ? + * \ { } | ( ) [ ] ^
"
If you include a double quotation mark in your regular expression pattern, it is used to match the exact occurrence of that character in the text you are searching. For example:
"example" will match the word 'example'
.
Matches any character. For example:
ab. will match 'aba', 'abb', 'abz', etc.
?
Indicates that the preceding character is repeated zero or one times. Often used to make the preceding character optional. For example:
+
Indicates that the preceding character is repeated one or more times. For example:
*
Indicates that the preceding character is repeated zero or more times. For example:
\
A backslash is used as an escape character to indicate that the character following it should be treated as a literal character and not a regex operator.
{}
In braces users can define the minimum and maximum number of times the preceding character can repeat. For example:
|
OR operator. The match will succeed if the longest pattern on either the left side OR the right side matches. For example:
( … )
Parantheses can be used to form groups within regular expressions. You can use a group to treat part of the expression as a single character. For example:
[ … ]
Brackets are used to match one of the characters within them.
Inside brackets, -
indicates a range unless -
is the first character or escaped. For example:
A ^
before a character in the brackets negates the character or range. For example:
Wildcards
Wildcards are placeholders in computing that can stand in for any character or group of characters, making it easier to find or match different variations of a word or phrase. These so called wildcard operators match one or more characters and can be combined with each other to create a wildcard pattern.
?
You can use the questionmark to match any single character. For example:
*
You can use the asterisk to match zero or more characters. For example:
“Phrase match” is unticked then the editor will prefix and suffix your typed text with “*”. Example: You type “hello”, the search to ElasticSearch will be “*hello*”
Copyright Wordbee - Buzzin' Outside the Box since 2008