containsPattern

Full name: taxi.stdlib.containsPattern

Signature

declare extension function containsPattern(source: String, regex: String): Boolean

Description

Returns true if any part of the source string matches the provided regular expression.

Uses partial matching — the regex does not need to match the entire string. Use ^ and $ anchors for full-string matching.

// Partial match — returns true if the string contains the pattern anywhere
find {
   startsWithHe: Boolean = "hello".containsPattern("^he")
   containsEll: Boolean = "hello".containsPattern("ell")
}

Examples

Demonstrates partial matching: anchor patterns, substring patterns, and non-matching patterns.

Try it out

Schema
Query Plan
Play with this snippet by editing it here, or edit it on Taxi Playground
Result
Query failed
Next
Welcome to Taxi