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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:23:26+00:00 2026-05-12T18:23:26+00:00

I’m teaching myself Perl and I learn best by example. As such, I’m studying

  • 0

I’m teaching myself Perl and I learn best by example. As such, I’m studying a simple Perl script that scrapes a specific blog and have found myself confused about a couple of the regex statements. The script looks for the following chunks of html:

 <dt><a name="2004-10-25"><strong>October 25th</strong></a></dt>
 <dd>
   <p>
     [Content]
   </p>
 </dd>
 ... and so on.

and here’s the example script I’m studying:

#!/usr/bin/perl -w

use strict;
use XML::RSS;
use LWP::Simple;
use HTML::Entities;

my $rss = new XML::RSS (version => '1.0');
my $url = "http://www.linux.org.uk/~telsa/Diary/diary.html";
my $page = get($url);

$rss->channel(title       => "The more accurate diary. Really.",
          link        => $url,
          description => "Telsa's diary of life with a hacker:" 
                 . " the current ramblings");

foreach (split ('<dt>', $page))
{
if (/<a\sname="
         ([^"]*)     # Anchor name
         ">
         <strong>
         ([^>]*)     # Post title
         <\/strong><\/a><\/dt>\s*<dd>
         (.*)        # Body of post
         <\/dd>/six)
{
    $rss->add_item(title       => $2,
               link        => "$url#$1",
                   description => encode_entities($3));
}
}

If you have a moment to better help me understand, my questions are:

  1. how does the following line work:

    ([^”]*) # Anchor name

  2. how does the following line work:

    ([^>]*) # Post title

  3. what does the “six” mean in the following line:

    </dd>/six)

Thanks so much in advance for all your help! I’m also researching the answers to my own questions at the moment, but was hoping someone could give me a boost!

  • 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-12T18:23:26+00:00Added an answer on May 12, 2026 at 6:23 pm

    how does the following line work…

    ([^”]*) # Anchor name

    zero or more things which aren’t “, captured as $1, $2, or whatever, depending on the number of brackets ( in we are.

    how does the following line work…

    ([^>]*) # Post title

    zero or more things which aren’t >, captured as $1, $2, or whatever.

    what does the “six” mean in the
    following line…

    </dd>/six)

    • s = match as single line (this just means that “.” matches everything, including \n, which it would not do otherwise)
    • i = match case insensitive
    • x = ignore whitespace in regex.

    x also makes it possible to put comments into the regex itself, so the things like # Post title there are just comments.

    See perldoc perlre for more / better information. The link is for Perl 5.10. If you don’t have Perl 5.10 you should look at the perlre document for your version of Perl instead.

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

Sidebar

Ask A Question

Stats

  • Questions 238k
  • Answers 238k
  • 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
  • Editorial Team
    Editorial Team added an answer Use subsetting: library(ggplot2) x <- data.frame(a=1:10, b=rnorm(10)) x$lab <- letters[1:10]… May 13, 2026 at 6:50 am
  • Editorial Team
    Editorial Team added an answer I have changed to ExcelPackage library, and now it works. May 13, 2026 at 6:50 am
  • Editorial Team
    Editorial Team added an answer Unless you have a billion icons, you're not likely to… May 13, 2026 at 6:50 am

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want use html5's new tag to play a wav file (currently only supported
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I've got a string that has curly quotes in it. I'd like to replace
In order to apply a triggered animation to all ToolTip s in my app,

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.