Solved

RegEx Pattern for Multiple Lines

Posted on 2006-06-27
2
176 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now