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

Explain the benefits of viewstate?

578


Differences between “dataset” and “datareader”.

558


How do I open an ashx file in windows 7?

571


Explain advantages of caching?

528


What are the types of validation in asp net?

545






Types of instancing properties and explain each. Tell the difference between multiuse,singleuse and globalmultiuse and which is default ?

2271


Explain difference between dataset and datareader?

602


What are the advantages and limitations of query string?

566


To get the values in two different controls to match which control you use it?

528


Explain what is an assembly?

554


How to create multi language website in asp.net mvc? : Asp.Net MVC

492


What is the sequence in which ASP.NET events are processed?

471


What is query string in asp.net?

559


What is the importance of Global.asax in ASP.NET?

549


Explain the difference between debug.write and trace.write?

531