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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:23:44+00:00 2026-05-15T07:23:44+00:00

I stored the mail contents(mail body) in database. I would like to extract the

  • 0

I stored the mail contents(mail body) in database.
I would like to extract the value of “src” attribute of the all image tag() from those mail contents.
One or more image may be included in mail body.

Please let me know how I have to acheive this in VB.NET?
Thanks.

  • 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-15T07:23:44+00:00Added an answer on May 15, 2026 at 7:23 am

    You can use a regular expression.

    Try
        Dim RegexObj As New Regex("<img[^>]+src=[""']([^""']+)[""']", RegexOptions.Singleline Or RegexOptions.IgnoreCase)
        Dim MatchResults As Match = RegexObj.Match(SubjectString)
        While MatchResults.Success
            ' SRC attribute is in MatchResults.Groups(1).Value
            MatchResults = MatchResults.NextMatch()
        End While
    Catch ex As ArgumentException
        'Syntax error in the regular expression (which there isn't)
    End Try
    

    Here’s how it works:

    <img[^>]+src=["']([^"']+)["']
    
    Match the characters "<img" literally «<img»
    Match any character that is not a ">" «[^>]+»
       Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
    Match the characters "src=" literally «src=»
    Match a single character present in the list ""'" «["']»
    Match the regular expression below and capture its match into backreference number 1 «([^"']+)»
       Match a single character NOT present in the list ""'" «[^"']+»
          Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
    Match a single character present in the list ""'" «["']»
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my stored procedure is like below, select T.TranNo,(Select Accountname from Accountable where AccountCode =T.tranAccountCode)
how we can store the e mail id into a database? i mean which
My CI sessions are stored in my database. I have a native PHP script
in grails-mail plugin you need do define your inline image data in your service,
I currently am using: mail($to, $subject, $body, $headers); To send emails to my members.
Our project has files stored in a sql server db as blobs. I'd like
I have some content which in the database has linebreaks stored and when I
I wanna save mail attachments with size in database. So I open mail in
I have this script below that i would like to tweak so it can
I have an application where the contents of e-mails that get sent are stored

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.