如何编写模式从字符串中获取值?

问题描述 投票:0回答:0

我正在尝试编写正则表达式以从字符串中提取。 我有这样的字符串:

instance that you are using is instance="x1-yy2-abcde-2.account.local:1111"

instance that you are using is instance="x1-yy2-asdfg-2.account.local:1111"

我要提取

x1-yy2-asdfg-2.account.local:1111
我不确定如何。

现在我已经写了这个但是这给了我两个提取的实例名称

/instance="(?<text>[^"]+)"/g

regex string bash find-occurrences
© www.soinside.com 2019 - 2024. All rights reserved.