Regular Expression in Viewer App

Overview of Regular Expression Functions

Regular Expression functions serve as a powerful tool within the Viewer App, allowing users to define complex search patterns and manipulate text-based data effortlessly. These functions enable users to specify patterns of characters they are looking for within a given dataset, making it easier to extract specific information or perform data transformations. By using regex functions, users can perform tasks such as finding and replacing text, extracting data based on predefined patterns, and validating input against specific criteria.

toRegex

Convert the given string to a regular expression.

{{toRegex "foo"}}
<!-- results in: /foo/ -->

test

Returns true if the given str matches the given regex. A regex can be passed on the context, or using the  toRegex helper as a subexpression.

{{test "bar" (toRegex "foo")}}
<!-- results in: false -->
{{test "foobar" (toRegex "foo")}}
<!-- results in: true -->
{{test "foobar" (toRegex "^foo$")}}
<!-- results in: false -->

Was this article helpful?

Text Functions in Viewer App
Query Data: Viewer Tips
Feedback