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 / kp

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 ?    19 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is session id generated?

641


What is data cache in sql server?

796


What is css in asp.net?

748


Explain what are webservices?

717


How to create events for a control?

750


Is viewstate secure?

718


Can you set the session out time manually?

578


What are the Types of authentications in IIS

779


Is asp.net and .net same?

718


Which browsers support the xmlhttprequest object?

696


How can you ensure a permanent cookie?

747


What is http request and response?

706


How would ASP and ASP.NET applications run at the same time on the same server?

2163


What is difference between Lambda Expression and LINQ in ASP.NET?

720


Where is session cookies stored?

695