From the given paragraph of text, write a program to match
the strings of format “Any number of numerals followed by
an underscore followed by any number of alphabets"
ex:123_abc
(Note:using regular expressions)

Answer Posted / thanvir

private void RegExp(string input)
{
string s = input;
Regex regexp = new Regex("^[0-9]*_[A-Za-z]*$");
if(regexp.IsMatch(input))
Console.WriteLine("Matched");
else
Console.WriteLine("Not Match");
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

A web service can only be written in .net? State whether true or false.

538


Explain how asp.net different from asp?

559


What is difference between session and cookies?

547


How you can access the properties and controls of master pages from content pages?

508


Explain Features in ASP.NET

575






What is side-by-side execution? Can two applications, one using a private assembly and other using a shared assembly, be stated as side-by-side executables?

569


Are there any resources for drop-in replacements for the default css that comes with the ASP.NET Website template?

561


Define caching.

624


What are server side controls?

530


Explain the concept of MVC Scaffolding?

591


What is the file extension of web service?

554


What are the advantages of Web API?

634


code for "For every 5days system has to create 1text file with the corresponding date and it has to store in c-drive" by using web applications

1413


Can you explain page lifecycle in net?

506


In a Repeater control how one can provide an alternating color scheme ?

566