PC Review


Reply
Thread Tools Rate Thread

Can I ignore linebreaks in Regex Singleline mode?

 
 
=?Utf-8?B?TXJOb2JvZHk=?=
Guest
Posts: n/a
 
      31st Dec 2006
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 ?
 
Reply With Quote
 
 
 
 
Dave Sexton
Guest
Posts: n/a
 
      1st Jan 2007
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" <(E-Mail Removed)> wrote in message
news:FA7AC71E-5DF0-40ED-A9EE-(E-Mail Removed)...
>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 ?



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Format changes going across whole document rather than just a singleline GB Microsoft Outlook Discussion 0 29th May 2008 03:32 PM
RegEx: How to ignore the number of whitespaces? Florian Haag Microsoft Dot NET Framework 11 25th Jun 2007 12:42 PM
how do I handle linebreaks in Regex? =?Utf-8?B?TXJOb2JvZHk=?= Microsoft C# .NET 7 23rd Aug 2006 03:16 PM
regex pattern - ignore whitespace (CRLF and spaces)? Craig Buchanan Microsoft VB .NET 2 27th Mar 2006 06:48 PM
RegexOptions.Singleline is causing a timeout? David P. Donahue Microsoft C# .NET 1 27th Jul 2005 02:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:40 PM.