SQL Regexp_replace()函数

发布于 2025-02-08 06:10:29 字数 575 浏览 2 评论 0原文

我有一张名字的桌子,具有这样的价值:

客户
Marco Rossi
.paolo Esposito
Jimmi Montana
** luke Skywalker
Marinella ABC
-údrstMark
-úgoSrl

我想要的是在名称开头中删除所有特殊角色。 我使用了此功能Regexp.Replace('[^a-Za-Z0-9] | [^a-za-Z0-9] $/g',''))

,然后将我返回我几乎我想要的,但也删除了我 ú,找 因此,我没有[drst标记],而不是拥有[Drst Mark],

我可以在此函数中添加的内容是因为不在单词开头替换字符的角色?

非常感谢你。

I have a table with names that has the values like this:

Customer
marco rossi
.paolo esposito
jimmi montana
**Luke skywalker
marinella abc
- ÚDRST MARK
-úgo srl

What i wanted was to delete all the special characters in the beginning of the names.
I used this function REGEXP.REPLACE('[^a-zA-Z0-9]|[^a-zA-Z0-9]$/g',''))

And this return me almost what i wanted but delete me also the
Ú, ú
So instead of having [ ÚDRST MARK ] i have [ DRST MARK ]

What i can add in this function for not replacing the characters with accents in the beginning of the words?

Thank u so much guys.

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

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

发布评论

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

评论(1

爱人如己 2025-02-15 06:10:29

如果要保留u特殊字符,那么在非捕获组中添加它们呢?

REGEXP.REPLACE('[^a-zA-Z0-9Úú]|[^a-zA-Z0-9Úú]$/g',''))

它对您有用吗?

If you want to keep the Ú and ú special characters, what about adding them inside the non capturing group?

REGEXP.REPLACE('[^a-zA-Z0-9Úú]|[^a-zA-Z0-9Úú]$/g',''))

Does it work for you?

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