S
S
Senseich2019-02-26 14:39:24
Regular Expressions
Senseich, 2019-02-26 14:39:24

How to highlight text using a regular expression?

Hello! I need to select the text that is between the tags. Maybe I'm wrong, because. I haven't used RT for a long time, but it used to work <тэг>.*</тэг>and the text inside the specified tags was highlighted. But for some reason, everything stands out in my entirety, along with tags.
If I'm doing something wrong, please correct me. Tell me what the team will look like then?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2019-02-26
@Senseich

(?<=<тэг>).*(?=</тэг>)

D
Dmitry, 2019-02-26
@Compolomus

Add parentheses, (.*)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question