Click here to Skip to main content
15,917,645 members
Home / Discussions / C#
   

C#

 
AnswerRe: Any one having code to compare two xml files....? Pin
April Fans14-Jan-10 22:16
April Fans14-Jan-10 22:16 
QuestionNewbie struggling with ArgumentException Pin
x3mjeff14-Jan-10 16:55
x3mjeff14-Jan-10 16:55 
AnswerRe: Newbie struggling with ArgumentException Pin
Super Lloyd14-Jan-10 17:01
Super Lloyd14-Jan-10 17:01 
GeneralRe: Newbie struggling with ArgumentException Pin
x3mjeff14-Jan-10 18:15
x3mjeff14-Jan-10 18:15 
AnswerRe: Newbie struggling with ArgumentException Pin
Luc Pattyn14-Jan-10 17:29
sitebuilderLuc Pattyn14-Jan-10 17:29 
AnswerRe: Newbie struggling with ArgumentException Pin
x3mjeff14-Jan-10 18:32
x3mjeff14-Jan-10 18:32 
GeneralRe: Newbie struggling with ArgumentException Pin
Luc Pattyn15-Jan-10 0:43
sitebuilderLuc Pattyn15-Jan-10 0:43 
Questionregex problem [modified] Pin
uglyeyes14-Jan-10 15:35
uglyeyes14-Jan-10 15:35 
Hi,
my regex works fine in a regextest tool its just only when i try to filter the content via c# it doesnt work. here is my code
string fName = @"data.txt";//path to text file            StreamReader testTxt = new StreamReader(fName);            string allRead = testTxt.ReadToEnd();//Reads the whole text file to the end            testTxt.Close(); //Closes the text file after it is fully read.            string regMatch = @"(?<=\<div class=""middleadimggold""\>).*?(?=\</div\>)"; //string to search for inside of text file. It is case sensitive.            if (Regex.IsMatch(allRead, regMatch))//If the match is found in allRead            {                Console.WriteLine("found\n");            }            else            {                Console.WriteLine("not found\n");            }

part of the content that should match
<div class="middleadimggold">



<a class="asdf" href="http://www.asdf">
asdf</a>
<p>
asdf</p>
<p>asdf</p><p>asdf</p>

<p><span class="blue">asdf</span>
<a class="de" href="http://www.4asdf"><span class="a">(See on map)</span></a></p>

<p><span class="blue">asdf</span></p>



<span class="xx">


asdf
</span>

</div>

please note the spacing in the content, not sure if it matters?

modified on Thursday, January 14, 2010 10:06 PM

AnswerRe: regex problem Pin
uglyeyes14-Jan-10 16:37
uglyeyes14-Jan-10 16:37 
GeneralRe: regex problem Pin
OriginalGriff14-Jan-10 21:34
mveOriginalGriff14-Jan-10 21:34 
AnswerRe: regex problem Pin
Ravi Sant14-Apr-11 1:45
Ravi Sant14-Apr-11 1:45 
QuestionConverting Image file to binary file Pin
Member 451421814-Jan-10 15:08
Member 451421814-Jan-10 15:08 
AnswerRe: Converting Image file to binary file Pin
loyal ginger14-Jan-10 15:33
loyal ginger14-Jan-10 15:33 
GeneralRe: Converting Image file to binary file Pin
Luc Pattyn14-Jan-10 16:34
sitebuilderLuc Pattyn14-Jan-10 16:34 
AnswerRe: Converting Image file to binary file Pin
Giorgi Dalakishvili14-Jan-10 19:22
mentorGiorgi Dalakishvili14-Jan-10 19:22 
QuestionRequest: Help: Amazon Webservice with c#.net seemed to change things in recent update Pin
tonyonlinux14-Jan-10 13:15
tonyonlinux14-Jan-10 13:15 
AnswerRe: Request: Help: Amazon Webservice with c#.net seemed to change things in recent update Pin
Abhinav S14-Jan-10 16:01
Abhinav S14-Jan-10 16:01 
GeneralRe: Request: Help: Amazon Webservice with c#.net seemed to change things in recent update Pin
tonyonlinux14-Jan-10 18:04
tonyonlinux14-Jan-10 18:04 
Questionstring conversion to double Pin
Aljaz11114-Jan-10 12:01
Aljaz11114-Jan-10 12:01 
AnswerRe: string conversion to double Pin
Luc Pattyn14-Jan-10 12:57
sitebuilderLuc Pattyn14-Jan-10 12:57 
GeneralRe: string conversion to double Pin
Aljaz11114-Jan-10 13:02
Aljaz11114-Jan-10 13:02 
GeneralRe: string conversion to double Pin
DaveyM6914-Jan-10 13:12
professionalDaveyM6914-Jan-10 13:12 
GeneralRe: string conversion to double Pin
Eddy Vluggen14-Jan-10 13:13
professionalEddy Vluggen14-Jan-10 13:13 
GeneralRe: string conversion to double Pin
Aljaz11114-Jan-10 13:22
Aljaz11114-Jan-10 13:22 
GeneralRe: string conversion to double Pin
DaveyM6914-Jan-10 13:30
professionalDaveyM6914-Jan-10 13:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.