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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:02:53+00:00 2026-06-08T13:02:53+00:00

I am dealing with a table called ipaddr with a column called destination and

  • 0

I am dealing with a table called ipaddr with a column called destination and have entries in the column that look like and are of type varchar

tunnel://169.96.88.11:80/
url://169.96.88.30
169.96.88.59:443

These are all possibilities. I want to write a regex statement that returns true when it just matches the first three octets of the IP and nothing more. So, all three examples above match 169.96.88.

How do you write a regular expression so that I select rows in the table based on a specific ip address subnet?

select * from ipaddr where destination like '%169.96.88%'

That is, I am tying to collect all records that have a destination entry in the 169.96.88.* block.

  • 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-08T13:02:54+00:00Added an answer on June 8, 2026 at 1:02 pm
    SELECT *
    FROM   ipaddr 
    WHERE  destination ~ '(://|^)169\.96\.88\.[0-9]';
    

    The pattern starts at the beginning of the string or with ://.
    Then follows the network, a dot and at least one more digit.

    Tested with PostgreSQL 9.1.4. Note that I use the now default standard_conforming_strings. Else you have to write:

    WHERE  destination ~ E'(://|^)169\\.96\\.88\\.[0-9]';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQLServer table that stores employee details, the column ID is of
I'm dealing with a large multi-national corp. I have a table (oldtir) that shows
I'm dealing with a MySQL table that defines the JobName column as UNIQUE. If
I'm dealing with a Postgres table (called lives) that contains records with columns for
I am dealing with a table that contains both cars and owners (table CO
I have two tables I'm dealing with, patientTbl which consists of a PK called
Basically, I'm dealing with a horribly set up table that I'd love to rebuild,
I have a table with order information in an E-commerce store. Schema looks like
I have one database table dealing with users login totals and another table dealing
I understand that a lookup table is necessary when we are dealing with many-to-many

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.