473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

remove image tags in string

I have a HTML string that I want to remove all the <IMG ....... tags
from... any regex's out there for this? I basically just want to remove all
the images from the HTML.. thanks!
Aug 21 '07 #1
1 4618
"rowe_newsgroups" <ro********@yahoo.comschrieb:
>I have a HTML string that I want to remove all the <IMG ....... tags
from... any regex's out there for this? I basically just want to remove
all
the images from the HTML.. thanks!

I think the Regex pattern "<img\s.*?/>" should find all occurrences if
you use the SingleLine regex option.
This would work in most cases, but if 'SHORTTAG YES' is used, then it will
fail. Note that HTML is an SGML application and not XML!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Aug 21 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Nico Grubert | last post by:
Hello, I want to remove all html tags from a string "content" except <a ....>xxx</a>. My script reads like this: ### import re content = re.sub('<((|\n)*)>', '', content)
163
by: Shiperton Henethe | last post by:
Hi Know any good utilities to help me strip out the tags that Microsoft Excel 2002 leaved behind when you try and export an HTML format file? This is driving me NUTS. And really makes me...
9
by: Ken | last post by:
I am trying to create one image using JavaScript; then later in the script remove the image - not just remove the src. The following creates the image, but I have been unable to remove it. How...
7
by: BluDog | last post by:
Hi I am trying to store an image in an xml file, i vcan store it fine but the retreval is a bit of a problem: To String: Dim ms As New IO.MemoryStream Dim arrImage() As Byte...
8
by: handersonVA | last post by:
Hello, I'd like to put small images around a big image, so when a small image is clicked, that image is shown as a big image in the center. how should I do that? I will use a table tag to organize...
3
by: ad | last post by:
I have a string , it is make up of html tag and some text, like: <font color=red>Town </font></strong<strong>... How can I remove the html tag form this string with C#
1
Markus
by: Markus | last post by:
I'm making an image host and i'm wanting to add functionality to the host, so users can search the database for images. I'm going to have a section for adding tags to the, soon to be, uploaded...
14
by: Steve K. | last post by:
I have a method that I use to get a System.Drawing.Image from a file without keeping a handle on the file open (so I can delete the file). Here is the code: <code> public static Image...
11
by: David | last post by:
Hi All, I am working on a script that is theoreticaly simple but I can not get it to work completely. I am dealing with a page spit out by .NET that leaves empty tags in the markup. I need a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.