Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

in Gedit Can I use image tag for find and replace with a space.
I simply need to remove entire image tags in the html Using Find & Replace

share|improve this question

migrated from Jan 21 '10 at 11:04

This question came from our site for professional and enthusiast programmers.

THis would be better suited on Superuser. – Bobby Jan 21 '10 at 10:07
For one, this should be on Stack Overflow. The part about how to open search and replace is for SU, but the part about how to create a regex to replace image tags should be on SO. (where it will ultimately be shunned for trying to use regex to parse HTML) – Hello71 Jul 20 '10 at 17:29

You will need the "Regex Search & Replace" to do this. Here's how to install the plugin:

  • Download:
  • Open Nautilus and go to this directory: ~/.gnome2/gedit/plugins (create all of them if necessary)
  • Extract the contents of gedit2_regex_replace_plugin.tar.gz in ~/.gnome2/gedit/plugins (make sure that at the end you will have a directory named regex_replace and a file named regex_replace.gedit-plugin inside ~/.gnome2/gedit/plugins)
  • Now enable the plugin: Edit -> Preferences -> Plugins tab and check "Regex Search & Replace"
  • Click the Close button
  • Now let's use this plugin: press Control + Alt + H
  • In "Search for" write the following regexp: <img(.*)(/>|></img>)
    • (This should be enough to catch both "new" and "old" style img tags)
  • The plugin won't let your replace with an empty string so either push "Find" and manually delete all occurrences or insert a blank space and click "Replace all"
    • (Anyway I suggest to use "Find and Replace" so that you have a chance to review what is going to be removed).
share|improve this answer

You must log in to answer this question.