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

  • Home
  • SEARCH
  • 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 43387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:29:14+00:00 2026-05-10T15:29:14+00:00

I am just starting to learn javascript, so I don’t have the skills to

  • 0

I am just starting to learn javascript, so I don’t have the skills to figure out what I assume is a trivial problem.

I’m working with a WordPress blog that serves as a FAQ for our community and I am trying to pull together some tools to make managing the comments easier. Internet Duct Tape’s Greasemonkey tools, like Comment Ninja, are helpful for most of it, but I want to be able to get a list of all the IP addresses that we’re getting comments from in order to track trends and so forth.

I just want to be able to select a bunch of text on the comments page and click a bookmarklet (http://bookmarklets.com) in Firefox that pops up a window listing all the IP addresses found in the selection.

Update:

I kind of combined a the answers from levik and Jacob to come up with this:

javascript:ipAddresses=document.getSelection().match(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g).join('<br>');newWindow=window.open('', 'IP Addresses in Selection', 'innerWidth=200,innerHeight=300,scrollbars');newWindow.document.write(ipAddresses) 

The difference is that instead of an alert message, as in levik’s answer, I open a new window similar to Jacob’s answer. The alert doesn’t provide scroll bars which can be a problem for pages with many IP addresses. However, I needed the list to be vertical, unlike Jacob’s solution, so I used the hint from levik’s to make a
for the join instead of levik’s \n.

Thanks for all the help, guys.

  • 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. 2026-05-10T15:29:15+00:00Added an answer on May 10, 2026 at 3:29 pm

    In Firefox, you could do something like this:

    javascript:alert(   document.getSelection().match(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g)   .join('\n')) 

    How this works:

    • Gets the selection text from the browser (‘document.getSelection()’ in FF, in IE it would be ‘document.selection.createRange().text’)
    • Applies a regular expression to march the IP addresses (as suggested by Muerr) – this results in an array of strings.
    • Joins this array into one string separated by return characters
    • Alerts that string

    The way you get the selection is a little different on IE, but the principle is the same. To get it to be cross-browser, you’d need to check which method is available. You could also do more complicated output (like create a floating DIV and insert all the IPs into it).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just starting to learn Javascript; I do however have experience in programming using
I'm just starting to learn C++ so you'll have to bear with my ignorance.
Just starting out in asp.net. Have just created a login.aspx page in my site
I am just starting out with DI & unit testing and have hit a
im just starting to learn flex and im trying to understand how Flex does
I am just starting to learn F#. In several F# coding examples I see
As someone who is just starting to learn the intricacies of computer debugging, for
I'm a C++ programmer just starting to learn Python. I'd like to know how
I don't know much Javascript - just little of core language, but that can
Just starting to learn ASP.NET (C#) and I am using Visual Studio 2008. I

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.