XQuery - matches 函式



如果輸入與提供的正則表示式匹配,matches 函式將返回 true;否則返回 false。

語法

matches($input, $regex)

輸入引數

  • $input − 輸入字串。

  • $regex − 正則表示式。

示例

XQuery 表示式

let $input := 'TutorialsPoint Simply Easy Learning'
return (matches($input, 'Hello') =  true(),
matches($input, 'T.* S.* E.* L.*') =  true()
)

輸出

false
true

驗證結果

為了測試上述功能,用上面的 XQuery 表示式替換 books.xqy(在 環境設定 章節中提及)的內容,然後執行 XQueryTester java 程式來驗證結果。

列印
xquery_regular_expressions.htm
廣告
© . All rights reserved.