Solved

RegEx Pattern for Multiple Lines

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exit a vb6 apps when a calling it apps closes 15 52
How to compare ms sql hashbytes results within vb6 5 84
How to Add / Edit Windows Menu 4 67
backup program with robocopy 6 42
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

766 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