How do you find and replace "within selected text" in a textedit document (version 1.8, mountain lion)

In the textedit version on Snow leopard it was possible to search and replace within a peice of selected text only i.e. not the entire file. This was a very useful feature because you could select a paragraph and replace all occurences of word1 with word2 within that paragraph only! This feature appears to be missing from the mountain lion version of textedit (version 1.8). Or can anyone tell me how to do it ... ?

Having 46 people view a post without replying is not unusual. Some people look at a question to see if it's something they'd like to know the answer to, and then come back  when it has eventually been answered.
I'm not sure if you need to escape forward slashes in Dreamweaver's Find and Replace dialog box, but I normally do because both JavaScript and PHP normally use forward slashes as delimiters to mark the beginning and end of the regex like this:
var pattern = /[A-Z]{4}/; // JavaScript
$pattern = '/[A-Z]{4}/';   // PHP
When a forward slash appears inside the regex, you need to escape it with a backslash to avoid confusion with the closing delimiter.
As you have worked out, a capturing group is created by wrapping part of the regex in parentheses.
If you want to match exactly 38 characters, you can use [\S\s]{38}. That includes spaces, newline characters, symbols, everything.
If you're trying to find everything between two tags, you can do this:
(<\/tag_name>)([^<]+)
The closing tag is captured as $1 and everything up to the next opening tag is captured as $2.
Learning regular expressions is not easy. I don't claim to be an expert, but I enjoy the challenge of trying to solve them. If you're interested in regular expressions, there are several books published by O'Reilly. "Mastering Regular Expressions" is the ultimate authority, but it's a difficult read (not because it's badly written, but because of the complexity of the subject). "Regular Expressions Cookbook" is very good. There's also a new "Introducing Regular Expressions", but I haven't read it.

Similar Messages

  • How do I find and replace a word in PDF?

    How do I find and replace a word in PDF?

    In the Find window (Ctrl+F) there's an option to replace the searched text.
    This is in Acrobat XI, and there's no Replace All-function.
    On Thu, Jan 15, 2015 at 4:27 PM, claireb88184899 <[email protected]>

  • Inside mail, how do you find and delete old useless messages

    inside mail, how do you find and delete old useless messages, there are thousands of them.

    go thru all your mail boxes, and delete, all your synced boxes, highlight the stuff you want to trash, click delete.
    Go thru all the boxes and do the delete, then go to your server trash, and delete.
    You canthen go to on my mac and do the same thing.
    This is way different than 10.6.8, and I'm sure there is a much better way to do this, but at least it will get rid of some junk.
    Sorry this all I can offer.
    I'm sure someone who has been working with OS can offer a much better path.

  • How to prevent find and replace from finding linked files?

    I have a bunch of ASP pages that I need to update in the same manner with Find and Replace. In order to do this, I open all the files, use Find and Replace, and choose to Replace All in the Source Code of Open Documents.
    Pretty straightforward, right? Except, if I have any include file statements, such as this:
    <!--#include file=" yadda yadda"-->
    DW opens these files on its own, and updates THEM as well.
    This is a very frustrating behavior. I have been through the Preferences several times and I'm just not seeing any way to turn this off.
    I have tried Googling this problem, and have seen absolutely no mention of it.
    Does anyone know if this annoyance can be disabled?
    Thanks.

    I would try selecting the specific files in the Files tab, then using "Selected Files in Site" and see what happens.
    I think DW considers related files to be "open" (since you can edit them from within the main file they are related to) when that option is turned on and the files they're related to are open.

  • How do I find and replace text in PHP files?

    How can I in CS3 make sitewide changes to the text in PHP pages without changing variable names etc that have the same name?
    For example if I have an installation of a PHP forum and I want to change every instance of the word 'forum' to 'message board'...
    If I used the 'inside tag' search with " as the tag, then if "" contained a variable called 'forum' it would also be changed and therefore corrupt the code....
    Is there a simple way around this?
    Thanks!
    I'm using CS3 on Windows Vista.

    It looks like you're trying to find and replace source code, so you may be able to look at the various places that are looked at when finding and uncheck the ones that don't apply.
    But, if it's all source code then that won't help.  One thing that may work is to expand the search option - for example if the work "forum" that you're wanting to change it preceded by another word, or character or something that sets it apart, then do you find on that. You can expand that search phrase as far out in either direction that you need to to make it different, if of course that is practical in your situation.
    The only other way I can think of is to somehow create an exception rule, but I'm not sure if that's possible or how to do it.

  • How can i find and replace xml tags?

    Hi, i am using xml in my workflow and want to be able to remove certain tags if they contain particular text.
    here is an example of my xml structure…
    <entry>
        <name>DEFAULT</name>
        <tel>DEFAULT</tel>
        <address>DEFAULT</address>
    </entry>
    I am using this initial structure to set the paragraph styles to be followed when the xml data is imported.
    This leaves DEFAULT in place wherever an entry doesn't have any content for that field.
    I want to be able to import my XML then run a script that removes any tags that include DEFAULT, - I need the entire xml tag to be removed not just the text, if i do a normal find and replace it will only remove the text not the tags which is causing problems with styling. I also want to remove the end of para/return (^p) that i've placed at the end of the line. So it would be the same as opening up story editor and removing the content + tags + hard return in there, but i want to automate the process…
    So i think this is what i need to search for in each case
    "<name>DEFAULT</name>^p"
    and i want to replace it with nothing ""
    Can this be done through scripting (ideally javascript)?
    I have a little knowledge of javascript but am not sure how to search and target that kind of string in indesign...
    using indesign cs5
    many thanks

    Hi,
    Script should do it in two steps:
    1. find all occurences of i.e. ">DEFAULT<"
    2. remove whole paragraph which is a found_text's container.
    For example this way -JS - (a textFrame filled with your text should be selected) :
    var mStory = app.selection[0].parentStory;
    app.findTextPreferences =  null;
    app.findTextPreferences.findWhat = ">DEFAULT<";
    var myF = mStory.findText();
    var count = myF.length;
    while (count--)
         myF[count].paragraphs[0].remove();
    rgds

  • How do I find and replace recurring images?

    I was wondering if I could find and replace recurring thumbnails in a document. I actually want to delete the specific thumbnail in mass.

    Then Paste and Match Style option shift command v to remove the graphics.
    It is under the Edit menu of most OSX apps.
    There are also utilities that remove all styles and other formatting automatically for you when you do a simple copy and replace.
    Peter
    PS The Pages09_UserGuide.pdf is available from under the Help Menu.

  • In the new Numbers, can I find and replace within formulas like I used to in Numbers'09?

    I use Numbers with quite long formulas with reference to other tables. With Numbers'09, it was extremely useful to copy formulas and then use "find and replace" to change the terms within.
    Did they remove this option? I don't seem to be able to do that with the new Version.
    If it's still there, where do I find it?
    If it's not there.... why would they remove it.
    Thanks

    Basically, I use it for payroll, taxes, and so on... I have one sheet per employee (which compiles their weekly payroll). I have then different sheets which makes the quarterly taxes calculation (state and federal taxes - 941, 940, W2, disability,  UI, paystubs, tracks payments and deadlines, etc... ). It took me awhile to write all of the formulas, but now it does everything for me.
    When I add an employee. I have to add a sheet, but also add a line in the calculation sheets. Because all the employee sheets are the same format, all I need to do (or used to now) was to copy the line above, and just change the reference name of the employee sheet  within the formula (because there are several terms that are looked up, the reference name comes several time in the formula)... changing it manually is really annoying. What was taking me a minute or so, before, now takes me about 20 minutes. (between the different sheets, there are about between 75 to 100 changes in formulas per new employee - so the "find and replace" in formula only, was extremely useful).

  • How to use Find and Replace for CR or TAB

    How can I use PAGES 'Find and Replace' function to eliminate unwanted carriage returns or Tabs?
    I tried to copy the backwards P and paste into Pages find window, but that doesn't work.
    eMac   Mac OS X (10.4.4)   1 G RAM

    Copying & pasting should work, but it isn't necessary. In the Find & Replace fields hold down the Option key & hit the return or tab key.
    Peggy

  • How can I find and replace multiple words at once?

    I need to be able to find and replace words into queens English. For example, I need to replace all instances of "color" with "colour," "tire" with "tyre" etc.
    I'm new to scripting, so simple answers would be appreciated :)

    Hi hobs707,
    Please use the below code for your required output:
    Replace ("color", "colour")
    Replace("tire", "tyre")           
    //Replace("hobs707", "hobs007")     just copy and paste and edit the contents as your wish
    function Replace(input, output)
    app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences.findWhat = input;
    app.changeTextPreferences.changeTo = output;
    app.activeDocument.changeText();
    If the above answer is correct please provide Correct Answers for me.
    Regards
    Beginner

  • How can I find out if my mac mini running snow leopard can be upgraded to mountain lion?

    I have a mac mini with sufficient ram for the mountain lion OS however, I am unable to determine if the machine was created in early 2009.  Is there a way to make sure my machine will take the upgrade without purchasing the operating system first?

    Upgrade Paths to Snow Leopard, Lion, and/or Mountain Lion
    You can upgrade to Mountain Lion from Lion or directly from Snow Leopard. Mountain Lion can be downloaded from the Mac App Store for $19.99. To access the App Store you must have Snow Leopard 10.6.6 or later installed.
    Upgrading to Snow Leopard
    You can purchase Snow Leopard through the Apple Store: Mac OS X 10.6 Snow Leopard — Apple Store (U.S.). The price is $19.99 plus tax. You will be sent physical media by mail after placing your order.
    After you install Snow Leopard you will have to download and install the Mac OS X 10.6.8 Update Combo v1.1 to update Snow Leopard to 10.6.8 and give you access to the App Store. Access to the App Store enables you to download Mountain Lion if your computer meets the requirements.
         Snow Leopard General Requirements
           1. Mac computer with an Intel processor
           2. 1GB of memory
           3. 5GB of available disk space
           4. DVD drive for installation
           5. Some features require a compatible Internet service provider;
               fees may apply.
           6. Some features require Apple’s iCloud services; fees and
               terms apply.
    Upgrading to Lion
    If your computer does not meet the requirements to install Mountain Lion, it may still meet the requirements to install Lion.
    You can purchase Lion by contacting Customer Service: Contacting Apple for support and service — this includes international calling numbers. The cost is $19.99 (as it was before) plus tax.  It's a download. You will get an email containing a redemption code that you then use at the Mac App Store to download Lion. Save a copy of that installer to your Downloads folder because the installer deletes itself at the end of the installation.
         Lion System Requirements
           1. Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7,
               or Xeon processor
           2. 2GB of memory
           3. OS X v10.6.6 or later (v10.6.8 recommended)
           4. 7GB of available space
           5. Some features require an Apple ID; terms apply.
    Upgrading to Mountain Lion
    To upgrade to Mountain Lion you must have Snow Leopard 10.6.8 or Lion installed. Purchase and download Mountain Lion from the App Store. Sign in using your Apple ID. Mountain Lion is $19.99 plus tax. The file is quite large, over 4 GBs, so allow some time to download. It would be preferable to use Ethernet because it is nearly four times faster than wireless.
         OS X Mountain Lion — System Requirements
           Macs that can be upgraded to OS X Mountain Lion
             1. iMac (Mid 2007 or newer) — Model Identifier 7,1 or later
             2. MacBook (Late 2008 Aluminum, or Early 2009 or newer) —
                 Model Identifier 5,1 or later
             3. MacBook Pro (Mid/Late 2007 or newer) — Model Identifier 3,1 or later
             4. MacBook Air (Late 2008 or newer) — Model Identifier 2,1 or later
             5. Mac mini (Early 2009 or newer) — Model Identifier 3,1 or later
             6. Mac Pro (Early 2008 or newer) — Model Identifier 3,1 or later
             7. Xserve (Early 2009) — Model Identifier 3,1 or later
    To find the model identifier open System Profiler in the Utilities folder. It's displayed in the panel on the right.
    Are my applications compatible?
             See App Compatibility Table — RoaringApps.
         For a complete How-To introduction from Apple see Upgrade to OS X Mountain Lion.

  • How do you find and ipod touch if it is off and you dont have a serial number

    i have lost my ipod touch and it is off i dont know how to find it.Can some one help??????

    The only way is the old fashioned way, like if you lost a wallet or purse.
    - If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone. If the iPod has been restored it will never show up.
    - You can also wipe/erase the iPod and have to iPod play a sound via iCloud.
    - If not shown, then you will have to use the old fashioned way, like if you lost a wallet or purse.
    - Change the passwords for all accounts used on the iPod and report to police
    - There is no way to prevent someone from restoring the iPod (it erases it) using it.
    - Apple will do nothing
    Reporting a lost or stolen Apple product                              
    - iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number

  • How do I find and replace my dock to bottom of desktop?

    My dock is missing!? I'm unsure why…how to replace it at bottom of my desktop?
    Mahalo

    The Dock is managed by Dock preferences.

  • How can I search and replace the order items appear in the document?

    Here is my script. I am trying to replace instances of a text pattern (Lot ^9^9^9^9^9) with an auto incremented number Lot 1, Lot 2, Lot 3, etc... I believe this script produces unexpected results becuase the search result is ordered by document construction. The first item in myfounditems is the last item added to the document (which is on the last pages of the document), the second item in myfounditems is the next to last item that was added to the document (which was moved to a middle page in the document). The net result is that instead of having the first item on the first page being Lot 1) and the item directly below it being Lot 2), my document is a hodgepodge of Lot numbers is a seeminlgly random order. Any thoughts on how to fix this?
    tell application "Adobe InDesign CS5.5"
      --Clear the find/change preferences.
              set find text preferences to nothing
              set change text preferences to nothing
      --Search the document for the string "lot".
              set find what of find text preferences to "Lot ^9^9^9^9^9)"
      #set change to of change text preferences to "Lot " & lotnum & ")"
      --Set the find options.
              set case sensitive of find change text options to false
              set include footnotes of find change text options to false
              set include hidden layers of find change text options to false
              set include locked layers for find of find change text options to false
              set include locked stories for find of find change text options to false
              set include master pages of find change text options to false
              set whole word of find change text options to false
              tell active document
                        set lotnum to 1
                        set myFoundItems to find text
                        repeat with foundItem in myFoundItems
                                  set contents of object reference of foundItem to "Lot " & lotnum & ")"
                                  set lotnum to lotnum + 1
                        end repeat
              end tell
    end tell
    display dialog ("Numbered " & (count myFoundItems) & " lots in this document. Next starting lot number is " & lotnum & ".")

    You noticed the first one yourself: the Found item list seems to randomly jump around the document -- I believe you are correct in your observation it may be due to the object construction order. That tells me, by the way, something about your lot numbers that tou didn't mention: your text is not one continuous long threaded story, but it's all or partially in disconnected etxt frames. The Found list does return everything inside a single story in the correct order, but it goes over each separate story in the order they were constructed.
    The only solution is to gather all of your lot numbers, *re-sort* them according to the page number they appear on (and some sort of Worst Case Scenario is when you might have more than one lot number frame per page; in that case you also need to sort by textframe, top to bottom -- yet even worse is if you also may have these textframes side by side!).
    Only then you have a reliable counting order.
    This isn't too bad. We can just extend the method I offered for sorting top-to-bottom/left-to-right in Re: Working around the frame selection order issue in CS 4 and make it also include page numbers:
    function byPageYX(a,b) {
        var
            aP = a.parentTextFrames[0].parentPage.index,
            bP = b.parentTextFrames[0].parentPage.index,
            aY = a.baseline[0],
            bY = b.baseline[0],
            aX = a.horizontalOffset[1],
            bX = b.horizontalOffset[1],
            dP = aP-bP,
            dy = aY-bY,
            dx = aX-bX;
        return dP?dP:(dy?dy:dx);
    myResults.sort(byPageYX);
    Or something like that.
    As for actually implementing the above I cannot be of any help with Applescript.
    Once we're dealing with sorting I think you're much better off in Javascript anyhow.

  • How do I search and zoom to a text in a PDF document when I call the PDF document (in a shared location) from a web application(written in C#)?

    The location is something like this:
    \\XXX.XX.com\YY_YY_Docs\images\ZZZ_00001.pdf
    and I tried ( http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf)
    \\XXX.XX.com\YY_YY_Docs\images\ZZZ_00001.pdf#zoom=800&search=22-55
    but it only opens the document in the browser but does not zoom to it or search the text. How do I achieve this?
    Assuming not all the users have acrobat reader installed and opening the PDF in a browser with the Adobe reader add-on installed.

    Well, you need a PDF viewer – and that would be Adobe Reader.
    Those parameters only work for web-served documents, not for local ones.

Maybe you are looking for