Search & Replace Question (Regex?)

I downloaded a government website that I would like to modify and add to my website. (It's legal, copyright-free)
But I'm finding it difficult to work with because the pages are packed with sloppy code - JavaScript and CSS outside the head seciton, tables nested in tables, etc. I'd like to get started by zapping as much of the extra code as possible.
First, does anyone know of a search and replace function I can use that would delete the entire head section in every file in a folder? Second, do you know of a search and replace function that would delete everything up to a certain point?
For example, suppose the content I want to save begins with <table myID="HomeTable"> in every file. Is there a way I could delete everything up to <table myID="HomeTable"> in every file in a folder?
Or it might be easier if I simply did a search and replace to insert a particular code. For example, I could insert XYZ or < XYZ > or [XYZ] at a certain point in every file, then use some sort of regex to delete everything up to XYZ. Does anyone know of a regex code that would do that?
Thanks.

No, the file names are fine. I just want to insert or replace content in the files.
For example, every file might include the code <div class="iData">. So let's say I want to insert a line of code above that...
<include file.php>
<div class="iData">
No problem; I can easily do that be doing a search and replace operation that targets all files in all folders. But suppose I want to insert that line of code ONLY in folders named Ecology.php?

Similar Messages

  • A Search & Replace Question

    I should know this, but ... is there an easy way to search/replace something like H2O to H(subscript)2(normal)O? I know I could replace the formatting on all of the 2s, but that's not really practical.

    Scott -- not really much easier ... AFAIK, not even easier at all.
    JeffP, try this. If you use "Red" as a color in your document, replace it with another!
    * search for "H2O"; I think I would play it safe and switch on both case-sensitive and entire-word. Put no text in the Replace field, but, using the Format button, set its text color to "Red"
    * search for "2", with formatting "Red". Replace by subscript. Remember to switch off 'whole word'. It doesn't matter if you leave "Red" in the Replace formatting, because next
    * Delete the swatch "Red", replacing it with "Black" (or whatever your text color is; you never know!)

  • Need search & replace help dreamweaver 2006 (complicated question)

    Hello:
    if somebody could help with this I'd really appreciate it
    ....I have a site with tons of two word dir names word1_word2 a few are 3 word - there are a few images with this also (same as the dir names)
    I generate the site with the dir names in the metatage (discription and keywords) and at various places in the pages
    after building it I search and replace _ to space with dreamweaver (option not in any tag) so this kills the _ where ever it's visable but leaves it in img src and alt tags ect but most important leaves in metas where it looks like heck and I don't wan't it
    I've tired Everything in dreamweaver to search it out of metas and can't - I can live with it in alt img ect but rather not
    basic question"
    (is there a regex to leave _ only in hrefs & css styles and replace with space Everywhere else - if not remove in all visable text & metatags)
    beter yet can I do this with options in dreamweaver search & replace - 2 steps is ok - I killed the in visable text - I could live with them in alt & link titles but not in metatags (description and keywords)
    please Keep in mind I need it in href's (not the visable text though)
    thanks,
    MEF

    Just so I get this straight,  you want to change this:
    http://example.com/Annette_O_Toole/index.html
    to this:
    http://example.com/Annette O Toole/index.html
    Using spaces instead of underscores?  That is not a good thing.  You should  never use spaces or special characters in folder or filenames.  Ok?
    I hope this answers your question.  If not, post back with an example of what you're trying to change.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • Replace words with images, in a table, using the search/replace tool

    Hello everybody
    I have a question:
    Is it possible to replace words with images, in a table, using the search/replace tool?
    My case:
    I have a table with about 9000 articles on about 400 pages. In this table there are words which I like to replace with Logos.
    Example: The word "DM" should be the Logo "DM" (.eps). This word is about 1200 times in this table.
    Is it possible to replace it automatically?
    Thank you very much for your helb.
    Kind regards Alex

    Hello Mr. Werner
    Thank you for your reply.
    Can I ask you which Version of InDesign do you use?
    I use CS 5.5 and there I can't find the change field "other" you told me.
    Can you see it on the screenshot? (Sorry it is german...)
    Thank you very much for your support.
    Kind regards Alex

  • Search & Replace in Formulas

    Hello,
    I'm busy with a complex 'Numbers' file containing a lot of sheets & tables with many routines formulas.
    So basically the major differences between tables are minor changes in the formulas (*'table 1':: M2* becomes *'table 1" :: M3*, etc).
    My question is: is it possible to "Search & Replace" in "Formulas" all at once... BUT _in the active sheet ONLY_!
    Because up to now the only thing I can to is to "Search & Replace" step by step for each cell (which is taking ages!)... if I choose "Replace all" Numbers is doing it for the all document, not for the active sheet!
    Any idea?

    Can you copy the sheet to a new file - search and replace - then copy back?

  • [CC] Search&Replace: Bug only with Regular Expressions

    Can you confirm the following behaviour/bug?
    Steps to reproduce:
    1 Create a new document in DW CC
    2 Enter that text in the source code view:
    <p>&euro;</p>
    3 Open Search&Replace
    Field Search in: Current document
    Field Search: Text
    Field Search (3rd Field): €
    Start Search
    Result: As expected the "€" is found.
    4 [x] Regular Expressions
    Start Search
    Result: "€" isn't found
    Can you reproduce that?
    Do you regard that as a bug like me?
    If not, why please?
    Do you think it is technically impossible for the developers to solve the task?
    Do you think the developers forgot to gray out "text" in the choice box and allow regular expressions only in source code?
    Thanks.

    Nice that you like the nick
    Sure, I know that I can file a feature wish.
    But my main interest in this forum is to know, what other users think about certain features, why they think so, which they miss, which they regard as a bug, ...
    When I remember it right, you told me some time ago, that you don't use RegEx.
    Than I understand, that everything around that feature is not important for you.
    What I like to understand is, why you think the behaviour is logically.
    For me it is the opposite.
    You get a result with "Scope: Text", "[ ]RegEx".
    And you get no result with "Scope: Text", "[x]RegEx".
    Incredible strange.
    I would appreciate, if you could explain more detailed your view.

  • TestStand Design Search/Replace Functionality

    We are in the process of changing from using Measurement Studio/Visual Basic to using TestStand as the test executor. (We are just learning to use TestStand and LabView.)
    Currently, all testing is done using VB as the low level calls, and VB scripting for the test automation.
    Our plan is to start by putting the VB low level code into an Active-X DLL and as time permits, move the low level code to LabView.
    The question is, as we create replacement functions using LabView, how do we Replace the Active-X DLL calls with the LabView functions?
    My first thought was to use "Search and Replace" (as there is in most other language enviornments) but I can't find such a function in TestStand. IS THERE A WAY TO DO THIS?
    M
    y other thought is to somehow create a subsequence for EACH library call that points to a single block for that function, where that single block can be changed from the Active-X DLL call to a LabView call.
    Examples would be that we have a Read/Write Parameter function as:
    ReturnStatus=DLL_Parameter(Name,Instance,Value,Mode)
    We would eventually create a new function in Labview and would want to replace ALL instances of the DLL call with a similar LabView function.
    How do we design this in?
    Mikef

    Unfortunately a search/replace feature has only been introduced in the new TestStand V3.0. It allows for searching and some replacing of values, properties, etc. however this may not help what you are describing.
    It is possible to write you own custom search/replace code that uses the TestStand API and can scan through a sequence file for particular step names or types and then insert a new LabView Step and remove the old DLL call step.
    If you need to keep the DLL parameters you can access them using the Step.TS.SData cluster. (You may need to set the �Show Hidden Properties� in the Station Options to see this in the Sequence Editor).
    Check out the TestStand API Reference and some of the Examples included in TestStand on how to use it.
    Hope this helps
    Simon Holman
    Simon Holman
    Software Engineer
    Certified LabVIEW Developer
    Certified TestStand Developer
    measX GmbH & Co. KG.
    http://www.measx.com

  • [DW CC] Batch Search & Replace

    The GUI of the function search & replace does not offer any batch processes.
    Only one single search&replace could be saved and performed.
    Is there any way to perform a batch job via regular expressions in a file which can be applied?
    And to same different scopes (as in the GUI)?
    current document
    open documents
    folder
    marked files
    complete site
    text
    source code
    Is there may be an extensions which pimps the search&replace function?
    That's one of my mostly missed features since a long time.
    If you have a hint for me, I would appreciate that a lot.
    Thanks!

    mistershortcut wrote:
    That is not a rhetorical question. I'm really interested in your way of working with complex sites, with many documents to edit, ...
    I usually use PHP includes to avoid having complex sites with many documents to edit.
    Generally speaking, I can completely modify the layout of my entire site by editing a handful of includes, then uploading them. If I have repetitive content in many locations, it's either coming from the same place in a database or added by an include. Either way, a simple change to the include or data takes care of it.
    It's pretty rare for a site I create to have more than about 10-15 actual  pages. When they get larger than that, I typically convert them to being dynamically driven (php and mysql).

  • Search / Replace in Acrobat Pro 9 ??

    I have a PDF that needs some significant editing.   I can't go back to the source. I could accomplish a lot with a search / replace tool.  I've been searching through the help files and information online and I can't figure out if there is a search/replace tool in this product.  I have found the search / redact tool, but no search / replace.    Does anyone know if Acro Pro 9 has this feature?  If not, is there a free plugin that could do this...?  and in which version of Acrobat did they introduce search/replace?
    Thanks

    Yes there is search replace in newer versions, at least according to Adobe.  see here:
    Acrobat Help | Searching PDFs
    Find and replace text in PDFs
    Find and replace text in a PDF
    The Find toolbar searches the currently open PDF. You can selectively replace the search term with alternative text. You replace text one instance at a time. You cannot make a global change throughout a PDF or across multiple PDFs.
    Choose Edit > Find (Ctrl/Command+F). 
    Type the text you want to search for in the text box on the Find toolbar. 
    To replace text, click Replace With to expand the toolbar, then type the replacement text in the Replace With text box. 

  • Search & replace text programmatically in pdf file

    I need to search & replace text programmatically (preferably in .NET c#) in existing pdf file.
    Does anyone know how to do it (maybe with with Acrobat SDK) ?
    Thanks in advance!
    A.
    PS: Well done working example :-)

    Searching APIs are provided, but there no APIs for replacing since that's not a standard operation on a PDF (given the rendering model).

  • Search & Replace in LabVIEW

    Hello All
    Is there a way to do a "Search & Replace" in LabVIEW as in other e.g. text based programming languages?
    In LabVIEW you can right click at the object and select replace. But when I have many of instances this procedure is getting long.
    I know I can save other vi as the given vi, but this will replace also other instances in other projects, which I do not want.
    Thanks in advance.
    Pawel

    This could have partial usefulness for sub VIs, but not for plain LabVIEW items (who would want to do a global replace of all "add" with a "multiply"... ;-)
    Unlike in text based languages, "replace" is not such a clear cut operation. What do do if the terminals don't match? Often, it requires a manual cleanup.
    There are a few workarounds, depending on how your VIs are organized. Are both in user.lib?
    For example, if you really need to replace a subVI in a complex application, save it as development distribution, quit LabVIEW, then use explorer to temporarily rename the obsolete subVI and replace it with the new VI using the old name. Now re-open the toplevel VI, doubleclick any instance of your new subVI and give it the new more appropriate name. Save e
    verything again and all will be updated to call the new subVI using the new name.
    Now rename the old subVI back to what it was so other projects that use it don't choke.
    LabVIEW Champion . Do more with less code and in less time .

  • Organize Bookmarks: I want to rename a batch of ~100 bookmarks with search-replace

    Organize Bookmarks:
    I want to rename a batch of ~100 bookmarks
    changing words in the "name" field with search-replace
    Please
    (a) tell me a work-around, or
    (b) program a plugin for a more advanced bookmarks editor.
    thanks a lot!

    You will have to export the bookmarks to an HTML file and edit that file to make the change. You need to remove all existing bookmarks before re-importing that changed file or you will have to remove all duplicates. If all the bookmarks that need to be changed are in one folder then you can remove the other bookmarks while editing.
    See http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox

  • Search&Replace with wildcard?

    I always use search and replace with Homesite but I wonder if
    there is a way of using a wildcard? I often want to replace text at
    the beginning and end of variable text. I mean, if I have this:
    <h3>First text</h3>
    <h3>Second text here</h3>
    What I'd like is, using the * as a wildcard, is to use
    something like this:
    Replace <h3>*</h3> with <h2>*</h2>
    Any ideas? Thanks

    you can use the extended search/replace with regular
    expressions to do this.
    So for example. Bring up the Extended Replace (Ctrl + Shift +
    R)
    And in the Find box, put:
    <h2>(.*)</h2>
    in the Replace with box, put:
    <h3>\1</h3>
    note: \1 is the first match returned by the regular
    expression

  • Search & Replace special characters?

    Is there a way to search & replace for special characters, such as paragraph or tab marks?

    Not in Pages 5.2 because Apple made it new and improved.
    However both Pages '08 and Pages '09 can search on invisible characters, precisely because they are not new and improved.
    Peter

  • Search & Replace function in Files?

    Does there exist a "Search & Replace String" function for Files IO? ...preferable RandomAccessFile.
    Or do I have to make my own parser from scratch.
    Anyone know of free code that exists somewhere? This seems like a function that someone must have made at least or has a use for.
    Thanks for any! :)
    rasmasyean

    The JDeveloper Editor provides Search & Replace functionality for files.
    What I typically do is
    Select menu: Search | Search Source Path...
    Enter Search String and Change Source path
    and other fields and press Start
    Then the Navigator displays a Search tab which lists all files with the matching string.
    Double click on first file in navigator and
    select menu Search | Replace
    In this dialog enter your search, replace, and other options-
    In the Options, If you do not want to be prompted, do not check the Prompt on replace option.
    Select the Scope of Global
    Selectg the Origin of Entire
    When you are ready press the Multiple button to make multiple replacements.
    When you are done with this file,
    Press Ctrl-S to Save the file
    Press Ctrl-F4 to close the window
    Double click on the Next File
    Press Ctrl-R to invoke the Search | Replace dialog.
    You should not need to change any options.
    Press Alt-M to select the Multiple Button!
    While this may seem more complex then a simple Sed / Perl / Python script, it is more controllable, flexible and user friendly.
    Besides, you may learn a few JDeveloper tricks.
    Good Luck,
    -John

Maybe you are looking for

  • Patch set from 10g Enterprise Edition Release 10.2.0.1.0 to 10.2.0.3.0

    Hi, Can you please provide me the patch set to upgrade from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production for Windows 32bit to Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production for Windows 32bit and instr

  • Is OCS a real File system or Virtual file system?

    Hello gurus, I would like to ask pros some fundamental questions regarding OCS. 1. Are files and folders in ocs are stored as real system files and directories in OS somewhere ? 2. Are the files or folders all all maintained in database itself? We ar

  • The "pac man" theme song is playing in a loop when I open Firefox

    When I open Firefox on my home pc (not laptop) the pac man theme music plays in a loop. == This happened == Every time Firefox opened == an hour ago

  • Cfdiv refreshes binding to radio buttons

    Hi, Fairly simple issue that I can't find much information about through google (just one report of it involving a workaround for a cfgrid rather than a cfdiv). I have a cfdiv that is bound to a cfselect and two radio buttons, ala: <cfdiv bind="url:s

  • Omniportlet and web cache

    I am setting up the omniportlet. I get the following message: Web Cache Invalidation default config file not defined by oracle.http.configfile REASON: oracle.http.configfile system property is not defined when you start OC4J Does anyone have a clue a