Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想取一行的特定部分,如下所示:
disk = ['C:/ParticionOne/lalala/bebebeb/disk.img], w']
我想在引号之间和第一个括号之前取文本,如下所示:
C:/ParticionOne/lalala/bebebeb/disk.img
我怎样才能做到这一点?给我一些如何做到这一点的线索,谢谢:D
你可以试试正则表达式
(?<=\[')[^\]]*
在哪里:
(?<=\[)
[
[^\]]*
]
这是正则表达式的样子:
调试演示