sql - String masking with Regex at Oracle
问题描述
I want to mask name and surname in Oracle. For example; John Smith => Jo** Sm**
I can write a PL/SQL function. But i want to do this with regex. I can't write the right template. Is regex the right solution? Is there anyone who can help?
解决方案
如果你想用正则表达式来做,你可以使用以下内容:
REGEXP_REPLACE('John Smith', '(\w{2})\w+', '\1**')
推荐阅读
- java - 未找到 Apache Commons CSV 映射
- laravel - Laravel 5.7:Eloquent Pivot 字段未使用 sync() 进行转换
- android - 无法使用 Firebase Cloud Messaging 在我的 Android 设备上接收通知
- reactjs - 反应合成事件奇怪的行为
- django - django-ckeditor 没有出现在 Django 的 grappelli 管理员上
- reactjs - 为什么 this.setState 不会更新状态对象?
- javascript - Laravel 中的地理编码 over_query_limit 和 LengthAwarePaginator 错误
- java - 迷宫算法在更复杂的输入上超时
- mysql - 一个审计如何在数据库中更改?
- java - 从匿名内部类修改局部变量