like.php
Table of Contents
Functions
- like() : string
- Check whether a pattern matches a string using wildcard matching.
Functions
like()
Check whether a pattern matches a string using wildcard matching.
like(string $text, string $search[, bool $caseInsensitive = false ]) : string
This helper wraps the ArangoDB AQL function LIKE(text, search, caseInsensitive)
which checks if the text matches the search pattern using wildcard characters.
The pattern supports wildcards: _ (single character) and % (multiple characters).
Example AQL usage:
LIKE("hello", "h%") // returns true
LIKE("hello", "h_llo") // returns true
LIKE("hello", "world") // returns false
LIKE("Hello", "h%", true) // returns true (case-insensitive)
LIKE("hello", "\\_") // returns false (literal underscore)
Parameters
- $text : string
-
The text to search in.
- $search : string
-
The search pattern with wildcards (_ and %).
- $caseInsensitive : bool = false
-
When true, matching is case-insensitive (maps to AQL's third
caseInsensitiveargument). Default false = case-sensitive.
Tags
Return values
string —The formatted AQL expression.