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

Why is global asax is used?

795


What is asp short for?

740


Where is the view state data stored?

756


Explain what is the procedure to create the environment for asp.net? : asp.net mvc

773


How can you enable impersonation in the web.config file?

771


What is use of Master Page in ASP.NET web pages?

806


Define asp.net caching?

752


What is csrf attack in asp.net?

692


What is a server farm in iis?

727


What are the security types in ASP/ASP.NET? Different Authentication modes?

763


In ViewState How much lifespan items stored?

816


What is an il?

735


What is meant by server side scripting?

705


Explain server-side scripting and client-side scripting.

686


What are the asp.net list controls and difference between them?

715