微软Office Access`LIKE` VS`RegEx`

编程入门 行业动态 更新时间:2024-10-15 22:26:34
本文介绍了微软Office Access`LIKE` VS`RegEx`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在使用Access关键字LIKE时遇到了麻烦,它的使用.我想以查询形式使用以下RegEx(正则表达式)作为一种验证规则",其中LIKE运算符过滤我的结果:

I have been having trouble with the Access key term LIKE and it's use. I want to use the following RegEx (Regular Expression) in query form as a sort of "verfication rule" where the LIKE operator filters my results:

"^[0]{1}[0-9]{8,9}$"

这怎么完成?

推荐答案

我不认为Access允许正则表达式匹配(在VBA中除外,但这不是您要的). LIKE运算符甚至不支持交替.

I don't think Access allows regex matches (except in VBA, but that's not what you're asking). The LIKE operator doesn't even support alternation.

因此,您需要将其拆分为两个表达式.

Therefore you need to split it up into two expressions.

... WHERE (Blah LIKE "0#########") OR (Blah LIKE "0########")

(#在Access中表示一位数").

(# means "a single digit" in Access).

更多推荐

微软Office Access`LIKE` VS`RegEx`

本文发布于:2023-10-15 08:52:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1493815.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:微软   Office   RegEx   Access

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!