Solved

RegEx Pattern for Multiple Lines

Posted on 2006-06-27
2
180 Views
Last Modified: 2010-04-07
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
Comment
Question by:DrDamnit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 16991468
Hi DrDamnit,

Try:

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

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

Regards,

Patrick
0
 
LVL 32

Author Comment

by:DrDamnit
ID: 16991939
I ended up using [.\s\S]* but thanks anyway!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question