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

What is viewstate in asp net with example?

525


Why session is more secure than cookies?

502


What are session objects?

512


How do you initiate validation on the server manually? What are two situations when you might you want to do that?

1363


Define the term Web Garden?

552






Which is faster viewdata or viewbag?

544


Define caching.

625


What is postback in asp net?

562


What is cookies cache and session?

542


In a page I have gridview with options of select and delete using hyperlink when I am selecting any one of then it has to open another page how can it?

507


How we can force all the validation controls to run?

527


How to do parallel database export in remote SQL Server in ESSL time track. It is working for local server but not working for remote SQL Server

5693


Is it possible to apply themes to an asp.net application? If yes, then how?

579


List the events in page life cycle.

554


What is http request and response?

535