Reputation: 652
I wanna take a specific part of one line, like this one below:
disk = ['C:/ParticionOne/lalala/bebebeb/disk.img], w']
I wanna take text between the quotes and before the first brackets, like that:
C:/ParticionOne/lalala/bebebeb/disk.img
How can i do that? Give me clues of how do that, thanks :D
Upvotes: 1
Views: 44
Reputation: 129507
You can try the regex
(?<=\[')[^\]]*
where:
(?<=\[)
is a positive lookbehind to ensure that our match is preceded by a [
.[^\]]*
is 0 or more non-]
characters.This is what the regex looks like:
Upvotes: 1