regex - Replacing a certain number of characters after a match in regular expression
问题描述
I want to find any instance of
\/Network\/Cambric Corporate Center\/
and replace the next 8 characters with nothing. So something like this
\/Network\/Cambric Corporate Center\/1164.DEV1164
Turns into this
\/Network\/Cambric Corporate Center\/1164
I'm working with a baked in replace regular expression visual programming piece, and this is my first post to here ever so please ask if more info is needed. I basically just need it to look like this
\/Network\/Cambric Corporate Center\/1164
if there is another solution without having to use replace It is for a frequently updated mass source of data that I need to edit to make more compatible with arrays
解决方案
尝试(\/Network\/Cambric Corporate Center\/).{8}
用 $1 替换以保留第一组,但不要保留其他任何内容。
这是替换的正则表达式:https ://regex101.com/r/F4Y4VD/1
推荐阅读
- python - 如何正确地与 keras 模型相互渗透精度,提供完美的线性关系输入与输出?
- java - 我已经为基本包执行创建了一个切入点(* com.blk.example.*.*.*)”但是@advice 方法根本没有调用..?
- javascript - 如何在 Angular-Electron 中侦听从主进程到渲染器进程的事件
- swift - 如何检查 Swift 字符串是否只包含某些字符?
- angular - 创建一个订阅,一旦捕获到一个有效的 authState,就会停止“轮询”
- installation - 为什么不能安装松露
- apache-kafka - 通过 zookeeper CLI 自动删除
- php - 如何解决路由器问题?我想检查 URI 是否存在,就像它的控制器和操作一样
- python - docker python如何回显到文件中
- php - Laravel API URL 参数和路由