Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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)

Answers were Sorted based on User's Feedback



From the given paragraph of text, write a program to match the strings of format “Any number of ..

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

From the given paragraph of text, write a program to match the strings of format “Any number of ..

Answer / raghuram

both the above answers are wrong....... Reg Exp should say..

new Regex("[0-9]*_[A-Za-z]*");

^ and $ mean beginning and end of a line... and the question
is to select that particular combination no matter where
they are present...... need not be entire line.

Is This Answer Correct ?    5 Yes 0 No

From the given paragraph of text, write a program to match the strings of format “Any number of ..

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

From the given paragraph of text, write a program to match the strings of format “Any number of ..

Answer / pio

Raghuram is right and his regex is 100% correct. The other
2 answers also have a string which does nothing:

string s = input;

so it is not necessary.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More ASP.NET Interview Questions

What is dataset and uses of dataset ?

6 Answers   HCL, TCS,


What namespaces are imported by default in ASMX files?

2 Answers  


Is react a template engine?

0 Answers  


What is work flow gen? how can it will work with .Net?

0 Answers   TCS,


what are the ways to improve performance in .net application?

7 Answers   Mind Tree,


Can we add code files of different languages in app_code folder?

0 Answers  


Can you explain page lifecycle in net?

0 Answers  


What are the Types of authentications in IIS

0 Answers   Microsoft,


Explain the main function of url routing system in asp.net mvc? : asp.net mvc

0 Answers  


How can we provide the WebParts control functionality to a server control?

0 Answers   MindCracker,


What are sessions and cookies?

0 Answers  


Is It Possible For Whole Page is Saved In View State? What Is View State?

2 Answers   Phoenix Technologies,


Categories