我有一个类似这样的字符串
xsd:import schemaLocation="AppointmentManagementService.xsd6.xsd" namespace=
我想从中提取以下内容:
AppointmentManagementService.xsd6.xsd
我尝试过使用正则表达式、bash 和 sed,但没有成功。有人可以帮我解决这个问题吗?
我使用的正则表达式是这样的:
/AppointmentManagementService.xsd\d{1,2}.xsd/g
最佳答案
你的字符串是:
nampt@nampt-desktop:$ cat 1
xsd:import schemaLocation="AppointmentManagementService.xsd6.xsd" namespace=
用 awk 试试:
cat 1 | awk -F "\"" '{print $2}'
输出:
AppointmentManagementService.xsd6.xsd
关于regex - bash - 提取字符串的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38427311/