如何使用Regex无需任何逻辑代码即可降低目录值

发布于 2025-02-12 20:18:17 字数 278 浏览 1 评论 0原文

对于贷款域,我们通过一些目录值,例如。如果客户是类似的主要客户或次要客户。因此,我需要检查值,无论大写,小写,骆驼。我使用的软件将仅接受正则码,而不是任何Java,JS代码(这是不同的脚本)。我只是尝试使用RegexP转换,但仍会遇到错误。

If catalogue_value ~"(/A-Z/)" then
Catalogue_value ~"/l"
Endif

由于我现在还在学习正则是目前仍在找出正确使用的表达式。 请告诉我正确的格式使用正则表达式将其更改为小写 /大写

For a loan domain we pass some catalogue values eg. if a customer is primary or secondary customer like that. So i need to check the values irrespective of uppercase, lowercase, camelcase. Software which i am using will accept only regex codes not any Java, js codes (it is different scripting). I am trying to convert only with regexp but still getting error.

If catalogue_value ~"(/A-Z/)" then
Catalogue_value ~"/l"
Endif

As i am learning regex as of now still figuring for correct expressions to use.
Kindly please tell me correct format to use regex to change into lowercase / uppercase

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哭泣的笑容 2025-02-19 20:18:17

如果我了解您的问题,则需要搜索而不必担心情况,例如,数据是Paul,您想通过Paul> Paul找到此记录搜索PaulPaul等?

这样做的一种通用技术是将双方全部放在上层或下情况下,例如,在javaScript中,

"Paul".toLowerCase() === "paUL".toLowerCase()

在SQL中:

select case when LOWER('Paul') = LOWER('paUL') then 1 else 0 end

If i understood your problem you want to search without worrying about the case, for example the data is Paul, and you want to find this record searching by PAUL, paul, PaUl, etc?

One common to technique to do that is to put both sides all in upper or lower case, without regex, for example, in javascript:

"Paul".toLowerCase() === "paUL".toLowerCase()

In SQL:

select case when LOWER('Paul') = LOWER('paUL') then 1 else 0 end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文