Celeb Glow
news | February 26, 2026

Regular Expression To Match Multiple Lines Of Text

I am trying to match lines that start with and end with the following tags using regular expressions:

<Description>
</Description>

Inbetween the tags, there can be multiple lines of text, how can I match this value? Example description tag:

<Description> test1 test2 test3 test4
</Description>

I tried multiple variants of regular expressions which have not worked, here's the latest one I tried:

<Description>(\n.*)</Description>

EDIT: I am using Visual Studio 17s find/replace component when using regular expressions. Also, there are multiple instances of the description tags.

2

2 Answers

This works for me in Visual Studio:

<Description>(\n|.)*?</Description>

It searches for end-of-line or any character, repeated, but not greedy (?).

1

Try:

<Description>([\s\S]*)</Description>
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy