Solved

RegEx Pattern for Multiple Lines

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

867 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

21 Experts available now in Live!

Get 1:1 Help Now