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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:48:48+00:00 2026-05-14T02:48:48+00:00

For example, scanning the contents of an HTML page with a Perl regular expression,

  • 0

For example, scanning the contents of an HTML page with a Perl regular expression, I want to match all file extensions but not TLD’s in domain names. To do this I am making the assumption that all file extensions must be within double quotes.

I came up with the following, and it is working, however, I am failing to figure out a way to exclude the TLDs in the domains. This will return “com”, “net”, etc.

m/"[^<>]+\.([0-9A-Za-z]*)"/g

Is it possible to negate the match if there is more than one period between the quotes that are separated by text? (ie: match foo.bar.com but not ./ or ../)

Edit I am using $1 to return the value within parentheses.

  • 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-14T02:48:48+00:00Added an answer on May 14, 2026 at 2:48 am
    #!/usr/bin/perl
    
    use strict; use warnings;
    use File::Basename;
    use HTML::TokeParser::Simple;
    use URI;
    
    my $parser = HTML::TokeParser::Simple->new( \*DATA );
    
    while ( my $tag = $parser->get_tag('a') ) {
        my $uri = URI->new( $tag->get_attr('href') );
        my $ext = ( fileparse $uri->path, qr/\.\w+\z/ )[2];
        print "$ext\n";
    }
    
    __DATA__
    <p><a href="../test.png">link</a> <a
    href="http://www.example.com/test.jpg">link on example.com</a>
    </p>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

example: I want to see if array[5] holds a value or is empty.
Example C API signature: void Func(unsigned char* bytes); In C, when I want to
Im not sure that it is the right way but I use this functions
I am scanning tweets to see whether they are retweets or not. The retweeting
I want to write some email scanning software and don't understand how to setup
Google is scanning my website on Google including a query string I don't want
I using annotation configuration for spring context like <context:annotation-config/> <context:component-scan base-package=example/> But project is
For example I have file config.xml in that file I have following xml content
Example: You have a shortcut s to SomeProgram in the current directory. In cmd.exe
Example I have Person , SpecialPerson , and User . Person and SpecialPerson are

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.