7
Answers

Regular Expression

Photo of Smart    Lucky

Smart Lucky

14y
2k
1
Aslam-o-Alaikum


if (Regex.IsMatch("testtest", @"^\w+$")) { // Do something here }

Why @ sign is used here....?

string pattern = "^a+$";
       if (Regex.IsMatch(content, pattern))
           Console.WriteLine("Pattern Found");
       else
           Console.WriteLine("Pattern Not Found");

and in this  @ sign is not used why......?



if(Regex.IsMatch(inputString, @"(?<First>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?<Second>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?<Third>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?<Fourth>2[0-4]\d|25[0-5]|[01]?\d\d?)"))
            {

in above expression ?<First> what is the meaning of this and ? whay it is first used...?

Any one who can help me....

Answers (7)

0
Photo of Pete Burkindine
NA 4 0 14y
Solved my own problem.  I had Embed Interop Types set to true (VS10).  Setting it to false turned Copy Local back on and let me use the library like a civilized person :D