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 8272645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:11:55+00:00 2026-06-08T07:11:55+00:00

I am working on what is basically an IP detector regex. Basically, I want

  • 0

I am working on what is basically an IP detector regex.

Basically, I want to remove all numbers that do not have periods in them.

For instance, here are some sample inputs:

1          >Matches
12         >Matches
134        >Matches
156        >Matches
1567       >Matches
1.99       >No Match
.100       >Don't care
1.2.3.4    >No Match
.1.2.3.4   >No Match

This is used to remove all the matches. Matches are separated by space. For instance, if I inputted the string:

"14. 24. asf.d 7 .12 .498 .s g 14091 87.49 .sdf.gs.df 12874 ds.fgs 9.127.41 sd.fg 92.47 sd.fg 892.14 sd.fg .79 12 s.df 47 8 .sdfg 1.9 sdfg 2.4 71. s9 24 .ds.f.g 71.9 8 s.df 4 .g 7 132. .sdfg 4 s.dfg"

I might be returned something similar to the string:

"asf.d .s g 87.49 .sdf.gs.df ds.fgs 9.127.41 sd.fg 92.47 sd.fg 892.14 sd.fg s.df .sdfg 1.9 sdfg 2.4 s .ds.f.g 71.9 s.df .g  .sdfg s.dfg"

I have gotten as far as:

([0-9]+)(?=)

But I am not sure how to make the regex ignore the numbers if they have periods in them ( and actually, I am not sure how to get it to first select numbers even if they have periods in them!)

  • 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-06-08T07:11:56+00:00Added an answer on June 8, 2026 at 7:11 am

    You could try this regular expression:

    "(?<![0-9.])[0-9]+(?![0-9.])"
    

    Explanation:

    • (?<![0-9.]): Negative look behind. Previous character is not 0-9 or a dot.
    • [0-9]+: One or more digits in 0-9.
    • (?![0-9.]): Negative look ahead. Next character is not 0-9 or a dot.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on some code, basically I have a form. On that form
basically I have a mongodb instance running and working on ec2. On the side
Basically I have a working application that sends an SMS after receiving an SMS.
I'm working on a CMS basically because I want to learn how to build
Basically, have a portfolio site I'm working on, with upwards of 15 pieces in
I'm working on an interface with a 3rd party app that basically needs to
I am working on a window in which I basically have a listbox (formed
Well I am working on a site that basically accepts PayPal payments to give
I basically have the core data and the app working correctly except for the
Basically I'm working on something that looks like the phone apps keypad. Everything else

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.