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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:39:09+00:00 2026-05-27T21:39:09+00:00

I am trying to use Perl to search through an html file, looking for

  • 0

I am trying to use Perl to search through an html file, looking for a semi-random string and store the match in a variable or print it out.

The string is the name of a jpg image and always follows the pattern of 9 digits followed by 6 lower case letters, i.e.

140005917smpxgj.jpg

But it is random every time. I am sure Perl can do this, but I will admit I am getting a bit confused.

  • 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-27T21:39:10+00:00Added an answer on May 27, 2026 at 9:39 pm

    Not too complicated. You may want to watch out for varying caps in the extension, e.g. JPG. If that is a concern, you may add (?i) before the extension.

    You may also wish to prevent partial names, e.g. discard a match that has more than 9 digits. That is the (?<!\d) part: Make sure no digit characters precede the match.

    ETA: Now extracts multiple matches too, thanks to ikegami.

    while (<>) {
        for (/(?<!\d)([0-9]{9}[a-z]{6}\.(?i)jpg)/g) {
            say;
            push @match, $_;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In perl I am trying to use a regex to search through specific hex
I am trying to understand how to use instance variable in Perl OO -
I am trying to use RegEx within my Perl script to parse a file
I'm new to Perl/HTML things. I'm trying to use $mech->get($url) to get something from
I am trying to use XML::RAI perl module on UTF8 coded text and I
Im trying to extract part of a line with perl use strict; use warnings;
In a Perl daemon reacting to various events I'm trying to use a Null
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I'm trying to use a simple perl one-liner on the following input: @F7##########0/1 C4CTA6GCAAC56G67CTCA99C
I'm trying to use getpos in Perl. I am using a FileHandle object in

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.