473,385 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Can I ignore linebreaks in Regex Singleline mode?

I want to match some HTML string using Regex but the linebreaks are getting me.

Is there a way to just completely ignore linebreaks in my regular expression?

If not, how would I specify a linebreak in the regex? I know how to do begin
line/end line but that only works in non-singleline mode right?

i.e.

if I have:

<div%gt;Some text
Some more text on next line
</div>

how would I match those 3 lines together ?
Dec 31 '06 #1
1 9129
Hi,

Here's a document that explains the Singleline and Multiline options:

..NET Framework Developer's Guide
Regular Expression Options
http://msdn2.microsoft.com/en-us/library/yd1hzczs.aspx

Singleline changes the meaning of the "." character and Multiline changes
the meaning of the "^" and "$" characters.

--
Dave Sexton
http://davesexton.com/blog

"MrNobody" <Mr******@discussions.microsoft.comwrote in message
news:FA**********************************@microsof t.com...
>I want to match some HTML string using Regex but the linebreaks are getting
me.

Is there a way to just completely ignore linebreaks in my regular
expression?

If not, how would I specify a linebreak in the regex? I know how to do
begin
line/end line but that only works in non-singleline mode right?

i.e.

if I have:

<div%gt;Some text
Some more text on next line
</div>

how would I match those 3 lines together ?

Jan 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Elliott | last post by:
I have an expression that works for single line but not multiline. What am I missing? expression = "<div(?<data1>.*?)>(?<data2>.*?)</div>"; MatchCollection mc = Regex.Matches(data, expression,...
2
by: Ginola | last post by:
Hi, I have a beginner of C# and I need to fix the bug for someone!! I have the codes like this Regex re = new Regex(@"<TR VALIGN=top><TD></TD>.*?</TD></TR>"); MatchCollection theMatches =...
2
by: Matt T. | last post by:
I am trying to replace the nested table tag in the follow string using a regular expression, but I am not having any success. I am new at using regular expressions, so I am sure I am just...
6
by: Du Dang | last post by:
Text: ===================== <script1> ***stuff A </script1> ***more stuff <script2> ***stuff B
2
by: Craig Buchanan | last post by:
I have a HTML fragment that looks like this: <tr> <td valign="top" nowrap><span class="textBold">Property ID: </span></td> <td valign="top" nowrap colspan="4"...
2
by: japi | last post by:
Hi, as a regex starter I am having a little trouble here. suppose i want to parse the folling html fragment: <li> a </li> <li>
7
by: MrNobody | last post by:
I'm trying to do some regex in C# but for some reason linebreaks are causing my regex to not work. the test string goes like this: string ss = "<tagname...
6
by: =?Utf-8?B?YXByMDUyNA==?= | last post by:
I am wondering if there is a devenv switch that will ignore build dependencies that are set in .xxproj files. At the command line I am attempting to build individual projects that I do not want...
3
by: R. K. Wijayaratne | last post by:
Hello everyone, I have something similar to the below and I am trying to select just the Block 1 markup/text <li><ul>...</ul></liwith the following RegEx @"<li>(.|\n)*<ul>(.|\n)*</ul>\n*</li>",...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.