Hi, I'm Ask INFA!
What would you like to know?
ASK INFAPreview
Please to access Ask INFA.

Table of Contents

Search

  1. Preface
  2. Understanding Data Types and Field Properties
  3. Designing Processes
  4. Using and Displaying Data
  5. Designing Guides
  6. Designing Process Objects
  7. Designing Service Connectors
  8. Using App Connections
  9. System Services, Listeners and Connectors
  10. Designing Human Tasks

Design

Design

matches

matches

The matches function in XQuery is used to determine whether a string matches a given regular expression pattern. This function is essential for pattern matching and text validation tasks.

Syntax

fn:matches(input, pattern, flags)
The following table describes the argument for this command:
Argument
Required/Optional
Description
input
Required
The input string to be tested against the pattern. If this argument is an empty sequence (
()
), it is treated as an empty string.
pattern
Required
A regular expression pattern against which the input string is matched. The pattern should be a valid regular expression according to the XML Schema definition.
flags
Optional
A string of flags that modify the matching behavior as follows:
  • m
    : Multi-line mode, where the start and end of line anchors (^ and $) match the start and end of any line instead of the entire string.
  • s
    : Single-line mode, where the dot (.) matches all characters, including line terminators.
  • i
    : Case-insensitive matching.

Return Value

Returns
true
if
$input
matches the regular expression supplied as
$pattern
as influenced by the value of
$flags
, if present. Otherwise, returns
false
.

Examples

The following table lists some sample values and return values:
SAMPLE FUNCTION
OUTPUT
fn:matches('query', 'q')
true
fn:matches('query', 'ue')
true
fn:matches('query', '^qu')
true
fn:matches('query', 'qu$')
false
fn:matches('query', 'q.*')
true
fn:matches('query', '[a-z]{5}')
true
fn:matches((), 'q' )
false
fn:matches('query', '[qu')
Error FORX0002
fn:matches("Hello World", "World")
true
fn:matches("Hello World", "^World")
false
fn:matches("Hello World", "hello", "i")
true
fn:matches((), "^$")
true

0 COMMENTS

We’d like to hear from you!