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 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

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer The code you pastebinned (not recommended for SO by the… May 11, 2026 at 11:02 am
  • added an answer It's my first day with postresql, but I think you… May 11, 2026 at 11:02 am
  • added an answer The way I usually do it is to instantiate DropReceiver… May 11, 2026 at 11:02 am

Related Questions

I am just starting to learn javascript, so I don't have the skills to
I am just starting to learn F#. In several F# coding examples I see
I am just starting to fiddle with Excel via C# to be able to
I am just starting to use Subversion with Tortoise SVN client for one of
I am just starting out with Silverlight (2 RC0) and can’t seem to get
I've been working with python for a while now and am just starting to
I'm just starting to design some embedded devices, and am looking for resources. What
I am just starting out with DI & unit testing and have hit a
I am just starting with C++ and got some problems in understanding how the
I am just starting with coding some JSP, which I find isn't all that

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.