• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 190
  • Last Modified:

RegEx Pattern for Multiple Lines

I am trying to find HTML Comments that will span multiple lines. I tried "<!-- Comment here -->.*<!-- End Comment -->" but was foiled by the fact that the dot charater does not prepresent vbCRLF. How would I find this:

<!-- Comment Start -->
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla sapien sem, venenatis vel, aliquam quis, aliquet sed, urna. Phasellus nunc mi, aliquam ut, porta eget, pharetra vitae, ante. Cras suscipit. Fusce volutpat, metus eget molestie auctor, sem leo auctor nisi, non mattis nisl mauris vel ante. Suspendisse potenti. Sed ut sem sagittis massa malesuada scelerisque. Curabitur nunc. Vestibulum dignissim orci vitae mauris. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec eget ante at diam interdum ultricies. Ut orci lectus, tempus in, tempus vitae, sollicitudin id, ligula. Phasellus suscipit.
<!-- Comment End -->

Thanks in Advance.
0
DrDamnit
Asked:
DrDamnit
1 Solution
 
Patrick MatthewsCommented:
Hi DrDamnit,

Try:

"<!-- Comment here -->[.\n]*<!-- End Comment -->"

The . finds anything except a newline character; the \n looks for the newline.

Regards,

Patrick
0
 
DrDamnitAuthor Commented:
I ended up using [.\s\S]* but thanks anyway!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now