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
What are resource file and how do we generate resource file?
Where is asp.net session stored?
What is the basic difference between asp and asp.net?
How can you enable impersonation in the web.config file?
Describe a Windows Service and its lifecycle ?
How do u declare static variable and how it is declared and what is its lifetime?
Elaborate differentiation between ViewState and SessionState?
How can you use a custom controls in ASP.NET application?
To load your generated dataset with data which method do you invoke?
Explain the difference between the web config and machine config.
What is loop in asp.net?
Can asp.net work on an nt server?
Can the unique key be null?
Less than one page, how many windows will you be able to maintain?
What is the difference between response.redirect and server.transfer?