正则表达式匹配仅开始

发布于 2025-02-07 18:23:56 字数 402 浏览 1 评论 0原文

我正在尝试匹配具有多个匹配的字符串上的正则表达式,但是我想匹配第一次出现,并且我希望仅在字符串开始时我的匹配项

,例如:4_12052022_01.ABC

在上面的中“ 4”是我的匹配目标。

但是我的字符串也可以具有1_231233_4_43.ABC之类的东西,因此在这里它不应匹配4的出现,因为它不在字符串的开头。

我正在使用SyncbackPro V9,并希望通过Regex进行过滤。

我尝试过的,似乎对我不起作用

4 _。*,这与上面的两个字符串匹配

^4 _。*,这在大多数在线的大多数测试都很好定期测试网站,但在Syncback中它行不通。

I'm trying to match a regular expression on a string that has multiple matches, but i want to match the first occurrence and i'm expecting my match only in the beginning of the string

E.g.: 4_12052022_01.abc

in the above "4" is my target for a match.

But my string can also have something like 1_231233_4_43.abc, so here it should not match the occurrence of 4 because it's not in the beginning of the string.

I'm using SyncbackPro v9 and want to setup filtering through regex.

What i have tried and doesn't seem to work for me

4_.*, this matches both the strings above

^4_.*, this tests fine in most of the online regular testing websites, but in syncback it doesn't work.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文