Click here to Skip to main content
15,886,199 members
Home / Discussions / C#
   

C#

 
GeneralRe: Article about making image background color transparent? Pin
Super Lloyd7-Aug-06 3:46
Super Lloyd7-Aug-06 3:46 
GeneralRe: Article about making image background color transparent? [modified] Pin
Super Lloyd7-Aug-06 3:54
Super Lloyd7-Aug-06 3:54 
GeneralRe: Article about making image background color transparent? Pin
wout de zeeuw7-Aug-06 4:30
wout de zeeuw7-Aug-06 4:30 
Questiona simple question about forms ? help please ... Pin
cmpeng347-Aug-06 1:23
cmpeng347-Aug-06 1:23 
AnswerRe: a simple question about forms ? help please ... Pin
stancrm7-Aug-06 1:33
stancrm7-Aug-06 1:33 
AnswerRe: a simple question about forms ? help please ... Pin
Tamimi - Code7-Aug-06 1:34
Tamimi - Code7-Aug-06 1:34 
QuestionHow to make sure that the outlook has done the send/receive process? Pin
sinanju7-Aug-06 0:46
sinanju7-Aug-06 0:46 
QuestionMatch Meta Characters between strings( Regular Expressions) Pin
abhinish6-Aug-06 23:47
abhinish6-Aug-06 23:47 
Hi!
need some help guys
i want to match strings as whole words through regular expressions which contain meta characters.

i tried the Regex.Escape method which "Guffa" suggested me ..

it works good and don't throw any exception but it do not match the whole word also.

m i again missing some thing..
here is my code:


public bool sSearchWholeWord()
      {		       
       string sSearchWord="***SPAM***";
                       
       string content="hi this is ***SPAM*** testing";

	string pattern =  @"\b" + Regex.Escape(sSearchWord) + @"\b";			       


       Regex re =new Regex(pattern,RegexOptions.IgnorePatternWhitespace);
		try			
                {			
                  if(re.IsMatch(content))				
                  {					
                   return true;
                  }
	          else				
                 {					
                 return false;				
                  }                        
                }                        
               catch(Exception e)			
                {				
                   Response.Write(e.ToString());				
                   return false;			
                 }                
         }

this returns false but according to me it should return true

also if i remove these meta charaters it returns true..

i dont know what m i missing



or is there any other way of matching these meta characters?

abhinav


abhinav

AnswerRe: Match Meta Characters between strings( Regular Expressions) Pin
leppie7-Aug-06 4:50
leppie7-Aug-06 4:50 
Questionposition of the cursor Pin
sarojkumarjena6-Aug-06 23:38
sarojkumarjena6-Aug-06 23:38 
AnswerRe: position of the cursor Pin
Stefan Troschuetz6-Aug-06 23:50
Stefan Troschuetz6-Aug-06 23:50 
QuestionI've done it but one more thing Pin
diddy346-Aug-06 23:28
diddy346-Aug-06 23:28 
AnswerRe: I've done it but one more thing Pin
fmardani6-Aug-06 23:55
fmardani6-Aug-06 23:55 
Generalyeah that will do but i need a diff.... Pin
diddy346-Aug-06 23:59
diddy346-Aug-06 23:59 
AnswerRe: I've done it but one more thing Pin
V.7-Aug-06 2:09
professionalV.7-Aug-06 2:09 
Questioncontrol windows media server programmatically Pin
pratik manandhar6-Aug-06 23:22
pratik manandhar6-Aug-06 23:22 
QuestionKeylogger in C# Pin
Naveed Noor6-Aug-06 23:20
Naveed Noor6-Aug-06 23:20 
AnswerRe: Keylogger in C# Pin
Colin Angus Mackay7-Aug-06 1:04
Colin Angus Mackay7-Aug-06 1:04 
AnswerRe: Keylogger in C# Pin
stancrm7-Aug-06 1:35
stancrm7-Aug-06 1:35 
AnswerRe: Keylogger in C# Pin
Sebastian Schneider7-Aug-06 1:40
Sebastian Schneider7-Aug-06 1:40 
AnswerRe: Keylogger in C# Pin
Drew McGhie7-Aug-06 6:34
Drew McGhie7-Aug-06 6:34 
QuestionC# data grid related question Pin
Muhammad Ahmed6-Aug-06 23:20
Muhammad Ahmed6-Aug-06 23:20 
AnswerRe: C# data grid related question Pin
abhinish7-Aug-06 0:35
abhinish7-Aug-06 0:35 
GeneralRe: C# data grid related question [modified] Pin
abhinish7-Aug-06 0:46
abhinish7-Aug-06 0:46 
GeneralRe: C# data grid related question Pin
Muhammad Ahmed7-Aug-06 0:47
Muhammad Ahmed7-Aug-06 0:47 

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.