TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
yokzu
NA
306
0
Regex problem
Feb 8 2012 6:13 AM
Hi,
I want to get all IP addresses in an textbox. My codes are below;
---------------------
Regex desen = new Regex(@"^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$");
Match m = desen.Match(textBox1.Text.ToString());
while (m.Success)
{
textBox2.Text += m.ToString()+"/n";
m = m.NextMatch();
}
------------------
But When I write 2 or more Ip addresses in textbox1, program cant find any IP address. When I write 1 IP address, it is find.
How can I find all the IP addresses?
Reply
Answers (
2
)
Problem with closing other instances of my application
How to import excel file in sql server2005 using c# windows application