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

Suppose You Want A Certain Asp.net Function Executed On Mouseover For A Certain Button. Where Do You Add An Event Handler?

645


Which property needs to be set for script manager control to extend the time before throwing time out expection if no response is received from the server?

537


What are different types of authentication techniques that are used in connection strings to connect .net applications with microsoft sql server?

528


Is asp.net core faster?

542


What is the parent class of all the web server control?

487






Explain about the .NET framework?

569


Is asp.net mvc still used? : Asp.Net MVC

510


Can I read the hard disk serial # of the client computer using asp.net?

554


Can you change a master page dynamically at runtime? How?

501


What is the appSettings Section in the web.config file?

582


What is ispostback property?

501


What is the difference between table and query?

548


What is difference between cache and session?

499


What is authorization in asp.net?

575


What is asp.net with mvc? : Asp.Net MVC

519