Microsoft Office Access `LIKE` VS `RegEx`

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

我在访问关键术语 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).

更多推荐

Microsoft Office Access `LIKE` VS `RegEx`

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

发布评论

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

>www.elefans.com

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