Skip to content

Instantly share code, notes, and snippets.

@sardinecan
Created July 7, 2020 10:12
Show Gist options
  • Save sardinecan/55612aeb52f678e972f4ab275f295380 to your computer and use it in GitHub Desktop.
Save sardinecan/55612aeb52f678e972f4ab275f295380 to your computer and use it in GitHub Desktop.
tokenize/regex mixed xml content
xquery version "3.1";
let $map := map {
"method": "xml",
"version": "1.0",
"indent": true(),
"use-character-maps": map {
"<":"<",
">":">"
}
}
let $data := "1/ <name>toto</name>, toto 2/ <name>titi</name>, titi 3/ <name>tutu</name>, titi"
let $regex := "\d/ .*?"
return fn:serialize(fn:analyze-string($data, $regex), $map)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment