Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6836335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:20:36+00:00 2026-05-26T23:20:36+00:00

Possible Duplicate: Validating an IP with regex I need the regular expression for finding

  • 0

Possible Duplicate:
Validating an IP with regex

I need the regular expression for finding strings like followings in Java:

http://69.39.233.135:8032
http://83.133.127.104
http://119.207.75.238:11120
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:20:37+00:00Added an answer on May 26, 2026 at 11:20 pm

    This pattern would fetch the desired results:

    http://\d{1,3}(?:\.\d{1,3}){3}(?::\d{1,5})?
    

    Matches an IP after http:// with an optional port.

    Note that this is a simplified validation of an IPv4 and will only match that they are one the correct format and not a valid one. And remember to add an extra backslash to escape each backslash in java.

    Here’s an example in java:

    String text = "http://69.39.233.135:8032 http://83.133.127.104 http://119.207.75.238:11120";        
    String pattern = "(http://\\d{1,3}(?:\\.\\d{1,3}){3}(?::\\d{1,5})?)";
    
    Pattern compiledPattern = Pattern.compile(pattern);
    Matcher matcher = compiledPattern.matcher(text);
    while(matcher.find()) {
        System.out.println(matcher.group());
    }
    

    Output:

    http://69.39.233.135:8032
    http://83.133.127.104
    http://119.207.75.238:11120
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: What is the best regular expression for validating email addresses? I'm using
Possible Duplicate: What is the best regular expression for validating email addresses? I am
Possible Duplicate: Using regular expression within a stored procedure I need to validate a
Possible Duplicate: What is the best regular expression for validating email addresses? I've been
Possible Duplicate: A comprehensive regex for phone number validation Greetings, I need to implement
Possible Duplicate: What is the best Java email address validation method? I need to
Possible Duplicate: Regular expression that matches valid IPv6 addresses Can any one know the
Possible Duplicate: Is there a validating HTML parser implemented in Java? Hi, Is there
Possible Duplicates: What is the best regular expression for validating email addresses? Is there
Possible Duplicate: How do you send email from a Java app using Gmail? How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.