Click here to Skip to main content
15,888,113 members
Home / Discussions / C#
   

C#

 
QuestionSync confusion Pin
J-Cop13-Mar-09 0:23
J-Cop13-Mar-09 0:23 
AnswerRe: Sync confusion Pin
Bharat Jain13-Mar-09 2:50
Bharat Jain13-Mar-09 2:50 
GeneralRe: Sync confusion Pin
J-Cop13-Mar-09 3:01
J-Cop13-Mar-09 3:01 
GeneralRe: Sync confusion Pin
Bharat Jain13-Mar-09 3:30
Bharat Jain13-Mar-09 3:30 
AnswerRe: Sync confusion Pin
Luc Pattyn13-Mar-09 2:56
sitebuilderLuc Pattyn13-Mar-09 2:56 
QuestionFrame CheckSum Calculation Problem Pin
ajorge200813-Mar-09 0:01
ajorge200813-Mar-09 0:01 
AnswerRe: Frame CheckSum Calculation Problem [modified] Pin
DaveyM6913-Mar-09 0:14
professionalDaveyM6913-Mar-09 0:14 
QuestionRegular expressions in C# Pin
KeithF12-Mar-09 23:28
KeithF12-Mar-09 23:28 
Hi All,

I need to compare a string to a regular expression to determine if the string is in this format. I am setting the string equal to a line read from a file.

Once i have read the line i want to compare it to a regx to determine if the string is formatted as follows:

Date Time (5-10 spaces) 123-12-123456

An example line:

09-02-2009 10:33 001-01-218913

The code i have currently is:

strFile = "C:\\test.txt";
using (StreamReader srTlog = new StreamReader(new FileStream(strFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)))    
{        
  while ((strLine = srTlog.ReadLine()) != null)        
  {            
    Regex pattern=new Regex("NOT SURE WHAT GOES HERE");            
    if(pattern.IsMatch(strToCheck))            
    {                
      //DO WHATEVER NOW            
    }
  }
}


I would appreciate any help.

Thanks
AnswerRe: Regular expressions in C# Pin
whaka12-Mar-09 23:48
whaka12-Mar-09 23:48 
AnswerRe: Regular expressions in C# Pin
psi_u13-Mar-09 1:05
psi_u13-Mar-09 1:05 
AnswerRe: Regular expressions in C# Pin
#realJSOP13-Mar-09 2:26
mve#realJSOP13-Mar-09 2:26 
Questionstring reference type? Pin
__DukeNukem__12-Mar-09 23:25
__DukeNukem__12-Mar-09 23:25 
AnswerRe: string reference type? Pin
DaveyM6912-Mar-09 23:37
professionalDaveyM6912-Mar-09 23:37 
GeneralRe: string reference type? Pin
__DukeNukem__12-Mar-09 23:45
__DukeNukem__12-Mar-09 23:45 
GeneralRe: string reference type? Pin
DaveyM6912-Mar-09 23:59
professionalDaveyM6912-Mar-09 23:59 
GeneralRe: string reference type? Pin
Luc Pattyn13-Mar-09 3:10
sitebuilderLuc Pattyn13-Mar-09 3:10 
GeneralRe: string reference type? Pin
DaveyM6913-Mar-09 4:25
professionalDaveyM6913-Mar-09 4:25 
Questionvehicle tracking Pin
R.Krishnakumar12-Mar-09 23:14
R.Krishnakumar12-Mar-09 23:14 
AnswerRe: vehicle tracking Pin
Eddy Vluggen12-Mar-09 23:23
professionalEddy Vluggen12-Mar-09 23:23 
GeneralRe: vehicle tracking Pin
R.Krishnakumar12-Mar-09 23:39
R.Krishnakumar12-Mar-09 23:39 
GeneralRe: vehicle tracking Pin
Pete O'Hanlon12-Mar-09 23:49
mvePete O'Hanlon12-Mar-09 23:49 
GeneralRe: vehicle tracking Pin
stancrm13-Mar-09 0:05
stancrm13-Mar-09 0:05 
GeneralRe: vehicle tracking Pin
Eddy Vluggen13-Mar-09 1:33
professionalEddy Vluggen13-Mar-09 1:33 
AnswerRe: vehicle tracking Pin
Michael Bookatz13-Mar-09 0:30
Michael Bookatz13-Mar-09 0:30 
AnswerRe: vehicle tracking Pin
#realJSOP13-Mar-09 2:28
mve#realJSOP13-Mar-09 2:28 

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.