微软Office Access`LIKE` VS`RegEx` [英] Microsoft office Access `LIKE` VS `RegEx`

查看:69
本文介绍了微软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`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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