简单的XQuery FLWOR返回不带数字的文本 [英] Simple XQuery FLWOR to return text without numbers

查看:114
本文介绍了简单的XQuery FLWOR返回不带数字的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何返回非数字文本?

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.

上下文,根据迈克尔·凯(Michael Kay)的注释:

context, per Michael Kay's note:

电子表格的每个单元格都有一个字符串. CSV数据只有一列.似乎只有名称缺少数字.在此假设下,希望将数据分解为块"以区分每个人.数据没有真正的模式.

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.

推荐答案

我希望返回不带数字的任何字符串.

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]'))]

这篇关于简单的XQuery FLWOR返回不带数字的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆