A
A
AlexSofar2020-06-11 08:51:23
Regular Expressions
AlexSofar, 2020-06-11 08:51:23

How to select all text between quotes using regex in sublime text?

Hello, I need to select all parameter blocks enclosed in special characters <>, the characters themselves are used to separate blocks. But when I write this expression (?<=<<)(.*\n)+(?=>>) all highlights are selected entirely. What am I doing wrong?

Result:
5ee1c50354029693532590.png
Expectation:
5ee1c58aecc49360836261.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-06-11
@AlexSofar

But when I write this expression (?<=<<)(.*\n)+(?=>>) all highlights are selected entirely. What am I doing wrong?

By default, quantifiers are greedy, but here you need to switch to lazy mode.
(.*\n)+ just add a question mark.
(.*\n)+?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question