regexxmlxquerybasexflwor

Simple XQuery FLWOR to return text without numbers


How do I return non-numeric text?

for $foo  in db:open("foo")
return $foo//text()

Assuming that every address or phone number cell from the original spreadsheet has numerals, I'm looking to return any string without numerals.


context, per Michael Kay's note:

Each cell of the spreadsheet has a String. There's only one column of what can easily be CSV data. Seemingly, only the names lack numerals. On that assumption, looking to break the data into "chunks" to differentiate each individual. There's no real pattern to the data.


Solution

  • I'm looking to return any string without numerals.

    Regex could do that:

    for $foo in db:open("foo")
    return $foo//text()[not(matches(., '[0-9]'))]