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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:26:47+00:00 2026-05-27T15:26:47+00:00

I would like to parse an HTML form and pull our filename’s of any

  • 0

I would like to parse an HTML form and pull our filename’s of any embedded images.

So the string could look like:

{ 

…
random HTML content

    image1.png 

 more random HTML content

    image3.png

…
}

From the above I would like to write a function in Java that returns to me
{image1.png, image3.png}.

I have a regular expression that returns to me only the last image name (image3.png) but it disregards previous image names. How can I capture all of them using regex?

All / any help would be appreciated.

  • 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-27T15:26:47+00:00Added an answer on May 27, 2026 at 3:26 pm

    https://stackoverflow.com/a/2059614/684934 give a good hint. More specifically, you’re probably looking for something like [a-zA-Z0-9_\-]+\.(png|jpg|gif|jpeg|tif)

    Note, however, that this is regex and is only looking for sequences of characters. If you are looking at a site that serves up dynamic images using servlets for example, and the resource URI doesn’t happen to end with a normal image file extension (such as .jsp or .do), then the regex will completely fail. It will also pick up any “image names” from any sort of text that happens to match, which does not actually represent an image on the page.

    To do the job properly, you will need to use some sort of DOM and traverse the <img> elements. (And the <button> elements, which may be of type image… there are probably more tags that can have images.)

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

Sidebar

Related Questions

I would like to parse a string such as p1=6&p2=7&p3=8 into a NameValueCollection .
I am using Xerces in Java. I would like to parse an HTML document
Essentially, I have a dynamically generated local HTML form that I would like to
I've put an html web resource on my contract form and would like to
I would like to parse an HTML table and disaply contents using XML to
I would like to know if there is a simple way to parse HTML
I would like to write a (HTML) parser based on state machine but I
I would like to parse a big sentence, which can contain names in fsharp.
I would like to parse a document using SAX, and create a subdocument from
I would like to parse the values from aspx pages, both what is passed

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.