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
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 |
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 |
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 |
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 |
How connect data into DropDownList from Aceess Table?
Which template must you provide, in order to display data in a Repeater control?
which is best possible way to add data source to data grid when the data is huge(10 lack recored)how to edit a perticular row
1. What is Connection Pooling…? 2. Maintaining Sessions in ASP.NET 3. ASP.NET page lifecycle. 4. Can we store objects in sessions. 5. What is AJAX..? 6. Serialization/Deserialization. Why we use serialization and Deserialization…? 7. What are Arrays and Arraylist..? 8. Difference between Authentication and Authorization…? 9. Difference between abstract class and Interfaces 10. What is a view..? Does a view contain data..? 11. What are triggers..? 12. What are transactions..? 13. What is Metaview (oracle)..? 14. What is Inheritance..? How can we call a method from the base class..? 15. Can an abstract class have zero abstract methods..? 16. How to read from Message Queue..? 17. What is Metadata..? 18. You would prefer to have business logic in c# or DB Side..? Why…?
1 Answers Franklin Templeton, Sky InfoTech,
Authentication and Authorization
How we generate the BARCODE in ASP.Net using c# ! in library management systen for books .
What are sessions used for?
what is <location> tag?
What are Caching techniques in .NET
What does asp stand for in asp.net?
What is state management react?
What methods are fired during the page load?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)