Click here to Skip to main content
16,017,351 members
Home / Discussions / C#
   

C#

 
QuestionCurves and Angles Pin
suresh sahu1-Sep-05 7:09
suresh sahu1-Sep-05 7:09 
AnswerRe: Curves and Angles Pin
Judah Gabriel Himango1-Sep-05 7:45
sponsorJudah Gabriel Himango1-Sep-05 7:45 
GeneralRe: Curves and Angles Pin
suresh sahu3-Sep-05 20:28
suresh sahu3-Sep-05 20:28 
Questionloading a com clientside. HELP!! Pin
femi ojemuyiwa1-Sep-05 7:04
femi ojemuyiwa1-Sep-05 7:04 
QuestionPasteSpecial into Word Pin
Rick Beideman1-Sep-05 6:33
Rick Beideman1-Sep-05 6:33 
QuestionRegex "Unrecognized Escape Seq?" Pin
...---...1-Sep-05 6:05
...---...1-Sep-05 6:05 
AnswerRe: Regex "Unrecognized Escape Seq?" Pin
S. Senthil Kumar1-Sep-05 6:14
S. Senthil Kumar1-Sep-05 6:14 
AnswerRe: Regex "Unrecognized Escape Seq?" Pin
Guffa1-Sep-05 6:21
Guffa1-Sep-05 6:21 
A. Specify the RegexOptions.Compiled flag when you create the object if you plan to use it more than once. It takes longer to create the object, but it runs faster.

B.
As regular expressions and C# strings use the same escape character, you have to escape the escape character. Use \\ to put \ in the string.

Also, you are missing the ^ and @ to specify the beginning and end of the string. Without them, any string containing a number will be valid, for an example the string "We have 200 horses.".

You have an extra space at the end of the pattern. Remove that.

[0-9] can also be written as \d.

Regex theRegex = new Regex("^[-+]?(\\d*\\.)?\\d+@");

Or you can use an @-quoted string:

Regex theRegex = new Regex(@"^[-+]?(\d*\.)?\d+@");


---
b { font-weight: normal; }

AnswerRe: Regex "Unrecognized Escape Seq?" Pin
hamster11-Sep-05 16:20
hamster11-Sep-05 16:20 
QuestionRotating an image Pin
suresh sahu1-Sep-05 6:05
suresh sahu1-Sep-05 6:05 
AnswerRe: Rotating an image Pin
leppie1-Sep-05 7:20
leppie1-Sep-05 7:20 
GeneralRe: Rotating an image Pin
suresh sahu3-Sep-05 21:31
suresh sahu3-Sep-05 21:31 
AnswerRe: Rotating an image Pin
Mohamad Al Husseiny2-Sep-05 15:08
Mohamad Al Husseiny2-Sep-05 15:08 
GeneralRe: Rotating an image Pin
suresh sahu3-Sep-05 21:28
suresh sahu3-Sep-05 21:28 
QuestionStill not understanding this stream thing Pin
Tom Wright1-Sep-05 5:50
Tom Wright1-Sep-05 5:50 
AnswerRe: Still not understanding this stream thing Pin
Guffa1-Sep-05 6:10
Guffa1-Sep-05 6:10 
AnswerRe: Still not understanding this stream thing Pin
S. Senthil Kumar1-Sep-05 6:11
S. Senthil Kumar1-Sep-05 6:11 
Questiondeleting files Pin
OMalleyW1-Sep-05 4:53
OMalleyW1-Sep-05 4:53 
AnswerRe: deleting files Pin
Dan Neely1-Sep-05 5:02
Dan Neely1-Sep-05 5:02 
AnswerRe: deleting files Pin
Dave Kreskowiak1-Sep-05 6:31
mveDave Kreskowiak1-Sep-05 6:31 
GeneralRe: deleting files Pin
OMalleyW1-Sep-05 6:55
OMalleyW1-Sep-05 6:55 
GeneralRe: deleting files Pin
Dan Neely1-Sep-05 7:08
Dan Neely1-Sep-05 7:08 
GeneralRe: deleting files Pin
Dave Kreskowiak1-Sep-05 7:36
mveDave Kreskowiak1-Sep-05 7:36 
GeneralRe: deleting files Pin
OMalleyW1-Sep-05 8:08
OMalleyW1-Sep-05 8:08 
GeneralRe: deleting files Pin
Dan Neely2-Sep-05 3:24
Dan Neely2-Sep-05 3:24 

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.