正则表达式 - 如果存在,则在字符之间提取字符串
如果存在(结肠字符),我将需要使用正则绳索在字符之间提取字符串。
示例:
- SX: 22AA 001 267
- 2294 0bb 267 :09
- 2294 0cc 267
在所有情况下,我都希望结果。
2294 001 267
谢谢大家。
I would need to use RegEx to extract a string between characters if they exist (The colon character).
Examples:
- SX: 22AA 001 267
- 2294 0BB 267: 09
- 2294 0CC 267
In all cases, I want the result.
2294 001 267
Thank you all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 this regex将它们匹配
not ,没有提及您使用的是什么语言,我决定不使用Lookarounds。因此,您必须从比赛中获得第一组。
You can use this regex to match them all
NOTE: As you did not mention what language you're using I decided to not use lookarounds. So you have to get the first group from the match.