Match Case in Find/Replace in TextEdit

Before updating to Lion, when using the Find/Replace function in TextEdit, I could choose to select "Ignore Case", or I could leave that deselected in which case it would only Find & Replace instances which matched the case of the text I entered.
Now on Lion, instead of that dialogue box poping up giving me that option, the Find / Replace function is built into the TextEdit window, and there's no option to select whether to match or ignore case. As it is, it just ignores case and replaces all matches for the text found, regardless of case.
That is not what I want! I need to match case!
Can I do that in Lion, or is that functionality completely gone?

like a lot of Apple "Interface Improovements" the stuff is well hidden. What i just found on another board: Just click on the magnifying glass icon (left of where you enter search text). A drop down menu will appear with search options - "Ignore Case".
There is also a lot of other neat stuff hidden there ... So happy searching! ;-)

Similar Messages

  • Simple Find/Replace in Textedit

    All I want to do is search a TextEdit document for a word and replace it with another word. For some reason, it's taking me hours to figure out how to do this. And all the scripts I found through google didn't work, so I don't know where to turn to now.
    Here's the part of the script that is suppose to be doing the find/replace:
    note, TextEdit is already activated earlier in the script
    tell application "TextEdit"
    tell application "System Events"
    tell process "Textedit"
    key down command
    keystroke "f"
    key up command
    keystroke "Last Update"
    keystroke tab
    keystroke "Created"
    click button "Replace All" of window "Find"
    end tell
    end tell
    end tell
    the script fails at the "click button" part. Up until then, everything works fine. I can even see the Find window open with the "Last Update" and "Created" texts in the right text fields.
    Anyone have any suggestions? I'm a noob, so you know, so you can be as sarcastic and condescending as you like in your replies, (not that I expect you all to be like that) but please also find the time slip in a helpful suggestion in there too

    Hey Marc
    This is what I was able to get working:
    tell application "TextEdit"
    tell application "TextEdit" to activate
    tell application "System Events"
    tell process "Textedit"
    key down command
    keystroke "f"
    key up command
    keystroke "Last Update"
    keystroke tab
    keystroke "Created"
    keystroke tab
    keystroke tab
    keystroke tab
    keystroke tab
    keystroke space
    end tell
    end tell
    end tell
    For some reason the Find window that pops up in your script isn't the default TextEdit Find. Having the "activate" command seems to fix that. I could never get it to click the button, so instead of the "click button" command I just tabbed to the command (make sure you have Move Between Controls toggled on, its ^F7 or just select it in System Preferences). After tabbing to the button the space bar activates it.
    I hope this helps
    -Jonathan

  • Find & Replace in TextEdit

    1. I'm trying to replace non-printing formatting characters (carriage return, line feed, tab, whatever) in a document with something else or, variously, replace existing text with a carriage return. I remember having a handy little cheat sheet made up with the substitutions for those characters for use in the Edit > Find windows, but it seems to have gone walkabout.
    2. Have pored through various Help files and other sources and, if there, I've just missed it over and over again. Can someone please point me to the right spot or, even better, just dump out what those special little codes are?
    3. TIA for any inputs or assistance.

    Hi, Michael.
    Depending on the type of document you are working upon, you might want to try the shareware application Tex-Edit Plus. This little wonder is my text editor of choice and is ideally suited to that kind of Find/Replace work. It also has a little button in the lower-left border labeled [A] that will show a table of ASCII character codes.
    You can try Tex-Edit for free.
    Apple's TextEdit does not even have a way of showing the non-printing characters.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • Match case in search and replace string

    Hi !
    Attached, my problem.
    I am searching "toto" in input string "toto+tototi" and replace "toto" by "A0".
    I want to "match case" the search input in order to get a string result : A0+tototi
    Does it exist options allowing to match case ?
    BR,
    Vincent
    Solved!
    Go to Solution.
    Attachments:
    MatchCase.vi ‏8 KB

    Please fill all your controls with typical strings, make the new values the default, save the VI under a new name, and attach it again.
    (This allows us to quickly reproduce your problem without entering strings and having to guess what your inputs actually are)
    WIth your given string, the result seems as expected, so we need more information on what you actually want instead.
    LabVIEW Champion . Do more with less code and in less time .

  • TextEdit - Save preset for Find & Replace?

    Hey, all!
    Quick question... is there any way to save a preset for a Find & Replace function in the native TextEdit app in Mac OS?  I do a routine F&R using a long "Insert Pattern" (I haven't had time to learn Regular Expressions yet in order to use another app)... I'd love to be able to just do a quick F&R on a text file instead of having to build the string every time.
    Possible?
    Thanks!
    -=R=-

    thnx Tom - yes, all the text is there, editable and I can add new text to it and save. But I can't search it using Find, trying unique words I see right there in the first few paragraphs atop the file. Then tried 'and' which only found two in the whole large file, embedded within a block of what I guess are formatting characters also bunched up at the bottom of the file below my original text.
    Oops, I just realized now that this file is not actually an RTF, its a Word 97 .doc -- which either means I converted it at some point in TextEdit, or its the original .doc file I started long ago with my ancient Microsoft Word that I used before going to Mavericks (was able to use Word in Snow Leopard but is no longer supported in Mavericks, I think its referred to as a 'PowerPC' application.) 
    What should I do? Would converting it to an RTF file help, if so how do I do that?
    thanks!
    Randy

  • Is there a setting to restore the old find-replace functionality in TextEdit?

    Am I alone in hate, hate, hating the recently new find-replace functionality in TextEdit?
    In earlier OSs -- and I'm not sure which was the last to do this -- Ctrl-F would pull up a find window that displayed both find and replace fields. I could type my search term... tab.... and type my replace term... and click "Replace all".
    In OS 10.8.4, I hit Ctrl-F and the find field opens... but I have to click a checkbox to do the replace. Then I have to click the "All" field to make it find-replace all.
    A quick search of the internet suggests I am the only one to find this annoying enough to register a username at apple.com and ask: Is there a way to make it go back to the old way? I'm getting old and life is already cluttered with too much click-clicking and checking and unchecking.

    Hi bandwag0n,
    Send your comments to:
    http://www.apple.com/feedback/
    We are not Apple here - we are just users like you....
    Cheers,
    GB

  • Is there a way to use the find/replace tool to select the actual step in the TestStand sequence instead of just listing matching values in the find window?

    The purpose of this is to be able to select many steps that are scattered throughout a sequence so I can change the step type one time.  I could do this now, but it would take me 30 minutes to click through the sequence and select all of the steps before I'd even change the step type because there are different steps inbetween the ones I want to select.  I wouldn't be able to just use the shift key to select multiple steps because of that.  I have about 500 steps I need to select, so it would be worth it to find an automated way to do that.
    Unless there's a way to change a step type from a numericlimittest to an action step type from the find/replace window???

    I ended up using ActiveX calls in TestStand to find the steps I wanted and change the step type to Action.  See attached example sequence.
    Attachments:
    Convert NumericLimitTest to Action step type example.seq ‏9 KB

  • Script to find/replace regular to Italic based on search terms in .txt

    Sorry for such a newbie post.
    I have been reading on JS scripts for find/replace.  I'm hoping develop a script or find one that is written that
    1. Looks into a .txt or any searchable file format, containing search terms
    2. Script will run on the entire Indesign document
    3. For any matching search terms script replace the style from regular to Italic, or from Bold to Bold/Italic. 

    Perfectly doable. Do you want to give it a go yourself?
    A few first thoughts (things I'd probably solve myself while writing the script):
    1. JS can read any file, but getting just the plain text out of an MS Word document is kind of ambitious -- even for me. Keep it simple: if your search text is nothing but a list of keywords or short phrases, write them out in a plain text file, one search item per line.
    2. With that I presume you mean not on one single continuous story, but all over the file -- including loose text frames, master pages, and what-have-you-got. Thass' easy, you can set the target for a Find or Replace operation with pin-point accuracy.
    3. .. This is the interesting part, actually.
    (a) Do you want to change the text style? That will set an override "+" for the modified text. It would be safer (wiser, etc.) to change it using a character style. (For the script it doesn't matter which method you use, this is just for the Future You who is going to edit this file in 6 months.)
    (b) If you do use a character style: what should happen if there already is one applied? Not bold or italic, but underline, for instance. Applying a new char style will override this one.
    (c) The naive approach (which I probably would have taken first) is to first search for each of the search terms, go over the 'found' list and test for each single entry if it's in regular or bold, then take appropriate action.
    A better approach -- without knowing anything else about this document -- could be to blindly use Replace to change ALL search terms in "Regular" to "Italic" and ALL search terms in "Bold" to "Bold Italic". It sure would be faster.
    (d) Just like in the interface, you can search for a word and 'change' only the formatting -- no need to change the text as well. And just like in the interface, you need to specify "whole words" and/or "case sensitive".

  • Find & Replace text in html files

    This is my first real attempt at using Automator, and it has become increasingly frustrating for me. I love the idea of Automator, nice interface, and it appears to be so easy to use. But, I can't get it to actually DO anything and I don't understand why.
    Here is my goal:
    to batch process multiple html files to remove certain characters and words (or replace them with empty space).
    I currently open these files in Pages and do 6 separate Find & Replace commands for each file before I continue with my other processing tasks. This is very tedious and I believe the computer should be able to find & replace multiple items at one time. (I have used other utilities to do batch renaming and trimming file names before.)
    All I want to do is select a group of files (usually 25 at a time) and have Automator get rid of all the unwanted words and characters before I open each file for final processing in Pages. I found a set of Automator actions for TextEdit which includes a Find & Replace action, but I've wasted over an hour so far trying to get it to work.
    When I run the workflow, it acts like it's doing something, but the files remain unchanged. I have tried using actions such as Read Text File, Get Contents of TextEdit Document, Set Contents of TextEdit Document, along with 6 instances of Find & Replace, but I cannot get it to work.
    I'm at a point today where I cannot afford to mess around with this anymore. I have to do it the long way in Pages or else I'll never get it done, but I want to get these Automator workflows to work before I have to repeat this task. (I do this at least once a week right now.)
    Any ideas or suggestions? I've tried reading in the help menus and support pages, but perhaps I'm just not understanding something here.

    Any ideas or suggestions?
    You might be interested in using TextWrangler. It can perform batch find-and-replace changes across multiple selected files.
    Good luck!
    Andrew99

  • Find Replace from Textfile with regex

    Hello.
    I'm wondering if anyone knows about an existing script that does a find/replace by list like the script "FindChangeByList.jsx" that comes with every InDesign installation.
    This consists of tow parts, the script itself with the functionality and a simple textfile where you have simple one-liners capable of find/replace with regex.
    the Textfile:
    //FindChangeList.txt
    //A support file for the InDesign CS4 JavaScript FindChangeByList.jsx
    //This data file is tab-delimited, with carriage returns separating records.
    //The format of each record in the file is:
    //findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description
    //Where:
    //<tab> is a tab character
    //findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use).
    //findProperties is a properties record (as text) of the find preferences.
    //changeProperties is a properties record (as text) of the change preferences.
    //findChangeOptions is a properties record (as text) of the find/change options.
    //description is a description of the find/change operation
    //Very simple example:
    //text          {findWhat:"--"}          {changeTo:"^_"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all double dashes and replace with an em dash.
    //More complex example:
    //text          {findWhat:"^9^9.^9^9"}          {appliedCharacterStyle:"price"}          {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}          Find $10.00 to $99.99 and apply the character style "price".
    //All InDesign search metacharacters are allowed in the "findWhat" and "changeTo" properties for findTextPreferences and changeTextPreferences.
    //If you enter backslashes in the findWhat property of the findGrepPreferences object, they must be "escaped"
    //as shown in the example below:
    //{findWhat:"\\s+"}
    grep          {findWhat:"  +"}          {changeTo:" "}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all double spaces and replace with single spaces.
    grep          {findWhat:"\r "}          {changeTo:"\r"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all returns followed by a space And replace with single returns.
    grep          {findWhat:" \r"}          {changeTo:"\r"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all returns followed by a space and replace with single returns.
    grep          {findWhat:"\t\t+"}          {changeTo:"\t"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all double tab characters and replace with single tab characters.
    grep          {findWhat:"\r\t"}          {changeTo:"\r"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all returns followed by a tab character and replace with single returns.
    grep          {findWhat:"\t\r"}          {changeTo:"\r"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all returns followed by a tab character and replace with single returns.
    grep          {findWhat:"\r\r+"}          {changeTo:"\r"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all double returns and replace with single returns.
    text          {findWhat:" - "}          {changeTo:"^="}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all space-dash-space and replace with an en dash.
    text          {findWhat:"--"}          {changeTo:"^_"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all dash-dash and replace with an em dash.
    The script:
    //FindChangeByList.jsx
    //An InDesign CS5.5 JavaScript
    @@@BUILDINFO@@@ "FindChangeByList.jsx" 3.0.0 15 December 2009
    //Loads a series of tab-delimited strings from a text file, then performs a series
    //of find/change operations based on the strings read from the file.
    //The data file is tab-delimited, with carriage returns separating records.
    //The format of each record in the file is:
    //findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description
    //Where:
    //<tab> is a tab character
    //findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use).
    //findProperties is a properties record (as text) of the find preferences.
    //changeProperties is a properties record (as text) of the change preferences.
    //findChangeOptions is a properties record (as text) of the find/change options.
    //description is a description of the find/change operation
    //Very simple example:
    //text          {findWhat:"--"}          {changeTo:"^_"}          {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}          Find all double dashes and replace with an em dash.
    //More complex example:
    //text          {findWhat:"^9^9.^9^9"}          {appliedCharacterStyle:"price"}          {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}          Find $10.00 to $99.99 and apply the character style "price".
    //All InDesign search metacharacters are allowed in the "findWhat" and "changeTo" properties for findTextPreferences and changeTextPreferences.
    //If you enter backslashes in the findWhat property of the findGrepPreferences object, they must be "escaped"
    //as shown in the example below:
    //{findWhat:"\\s+"}
    //For more on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //or visit the InDesign Scripting User to User forum at http://www.adobeforums.com
    main();
    function main(){
              var myObject;
              //Make certain that user interaction (display of dialogs, etc.) is turned on.
              app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
              if(app.documents.length > 0){
                        if(app.selection.length > 0){
                                  switch(app.selection[0].constructor.name){
                                            case "InsertionPoint":
                                            case "Character":
                                            case "Word":
                                            case "TextStyleRange":
                                            case "Line":
                                            case "Paragraph":
                                            case "TextColumn":
                                            case "Text":
                                            case "Cell":
                                            case "Column":
                                            case "Row":
                                            case "Table":
                                                      myDisplayDialog();
                                                      break;
                                            default:
                                                      //Something was selected, but it wasn't a text object, so search the document.
                                                      myFindChangeByList(app.documents.item(0));
                        else{
                                  //Nothing was selected, so simply search the document.
                                  myFindChangeByList(app.documents.item(0));
              else{
                        alert("No documents are open. Please open a document and try again.");
    function myDisplayDialog(){
              var myObject;
              var myDialog = app.dialogs.add({name:"FindChangeByList"});
              with(myDialog.dialogColumns.add()){
                        with(dialogRows.add()){
                                  with(dialogColumns.add()){
                                            staticTexts.add({staticLabel:"Search Range:"});
                                  var myRangeButtons = radiobuttonGroups.add();
                                  with(myRangeButtons){
                                            radiobuttonControls.add({staticLabel:"Document", checkedState:true});
                                            radiobuttonControls.add({staticLabel:"Selected Story"});
                                            if(app.selection[0].contents != ""){
                                                      radiobuttonControls.add({staticLabel:"Selection", checkedState:true});
              var myResult = myDialog.show();
              if(myResult == true){
                        switch(myRangeButtons.selectedButton){
                                  case 0:
                                            myObject = app.documents.item(0);
                                            break;
                                  case 1:
                                            myObject = app.selection[0].parentStory;
                                            break;
                                  case 2:
                                            myObject = app.selection[0];
                                            break;
                        myDialog.destroy();
                        myFindChangeByList(myObject);
              else{
                        myDialog.destroy();
    function myFindChangeByList(myObject){
              var myScriptFileName, myFindChangeFile, myFindChangeFileName, myScriptFile, myResult;
              var myFindChangeArray, myFindPreferences, myChangePreferences, myFindLimit, myStory;
              var myStartCharacter, myEndCharacter;
              var myFindChangeFile = myFindFile("/FindChangeSupport/FindChangeList.txt")
              if(myFindChangeFile != null){
                        myFindChangeFile = File(myFindChangeFile);
                        var myResult = myFindChangeFile.open("r", undefined, undefined);
                        if(myResult == true){
                                  //Loop through the find/change operations.
                                  do{
                                            myLine = myFindChangeFile.readln();
                                            //Ignore comment lines and blank lines.
                                            if((myLine.substring(0,4)=="text")||(myLine.substring(0,4)=="grep")|| (myLine.substring(0,5)=="glyph")){
                                                      myFindChangeArray = myLine.split("\t");
                                                      //The first field in the line is the findType string.
                                                      myFindType = myFindChangeArray[0];
                                                      //The second field in the line is the FindPreferences string.
                                                      myFindPreferences = myFindChangeArray[1];
                                                      //The second field in the line is the ChangePreferences string.
                                                      myChangePreferences = myFindChangeArray[2];
                                                      //The fourth field is the range--used only by text find/change.
                                                      myFindChangeOptions = myFindChangeArray[3];
                                                      switch(myFindType){
                                                                case "text":
                                                                          myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
                                                                          break;
                                                                case "grep":
                                                                          myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
                                                                          break;
                                                                case "glyph":
                                                                          myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
                                                                          break;
                                  } while(myFindChangeFile.eof == false);
                                  myFindChangeFile.close();
    function myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
              //Reset the find/change preferences before each search.
              app.changeTextPreferences = NothingEnum.nothing;
              app.findTextPreferences = NothingEnum.nothing;
              var myString = "app.findTextPreferences.properties = "+ myFindPreferences + ";";
              myString += "app.changeTextPreferences.properties = " + myChangePreferences + ";";
              myString += "app.findChangeTextOptions.properties = " + myFindChangeOptions + ";";
              app.doScript(myString, ScriptLanguage.javascript);
              myFoundItems = myObject.changeText();
              //Reset the find/change preferences after each search.
              app.changeTextPreferences = NothingEnum.nothing;
              app.findTextPreferences = NothingEnum.nothing;
    function myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
              //Reset the find/change grep preferences before each search.
              app.changeGrepPreferences = NothingEnum.nothing;
              app.findGrepPreferences = NothingEnum.nothing;
              var myString = "app.findGrepPreferences.properties = "+ myFindPreferences + ";";
              myString += "app.changeGrepPreferences.properties = " + myChangePreferences + ";";
              myString += "app.findChangeGrepOptions.properties = " + myFindChangeOptions + ";";
              app.doScript(myString, ScriptLanguage.javascript);
              var myFoundItems = myObject.changeGrep();
              //Reset the find/change grep preferences after each search.
              app.changeGrepPreferences = NothingEnum.nothing;
              app.findGrepPreferences = NothingEnum.nothing;
    function myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
              //Reset the find/change glyph preferences before each search.
              app.changeGlyphPreferences = NothingEnum.nothing;
              app.findGlyphPreferences = NothingEnum.nothing;
              var myString = "app.findGlyphPreferences.properties = "+ myFindPreferences + ";";
              myString += "app.changeGlyphPreferences.properties = " + myChangePreferences + ";";
              myString += "app.findChangeGlyphOptions.properties = " + myFindChangeOptions + ";";
              app.doScript(myString, ScriptLanguage.javascript);
              var myFoundItems = myObject.changeGlyph();
              //Reset the find/change glyph preferences after each search.
              app.changeGlyphPreferences = NothingEnum.nothing;
              app.findGlyphPreferences = NothingEnum.nothing;
    function myFindFile(myFilePath){
              var myScriptFile = myGetScriptPath();
              var myScriptFile = File(myScriptFile);
              var myScriptFolder = myScriptFile.path;
              myFilePath = myScriptFolder + myFilePath;
              if(File(myFilePath).exists == false){
                        //Display a dialog.
                        myFilePath = File.openDialog("Choose the file containing your find/change list");
              return myFilePath;
    function myGetScriptPath(){
              try{
                        myFile = app.activeScript;
              catch(myError){
                        myFile = myError.fileName;
              return myFile;
    This is a very useful and easy to maintain script which even people who cant write scripts (but know how to use regex) can do complex search replace mass replacements.
    Would love to find something like this for FrameMaker 12 (as i can't write scripts myself).
    regards
    daniel

    I have visited that site. The first item in the external link says: "You can also configure Firefox to automatically search for text when you type any characters outside of a text field. When typing in a text field these characters should show up in the text field and not trigger the Quick Find bar. "
    What I am looking for is the exact opposite. Once my first search is entered in the text box, and the info comes back, I want to start typing the next symbol, and have it automatically show up in the text box, not the Quick Find box. That is how it was working up until a couple of months ago.

  • Using Grep to find/replace

    I'm trying to find out how to use GREP in find/replace to chage the formatting of some text that comes in from a spreadsheet.
    I worked out the GREP query "~b(\d\d)~b", which finds a paragraph return, followed by two digits, followed by another paragraph return
    and then it is replaced by "\t $1~b", which is a tab, the two found digits and a para return.
    What i need to do is to amend the query to find ANY number of digits, (which may be comma delimited: eg 23, 36, 48 ,50), and then replace with a tab + found text.
    I suppose what I'm looking for is a way for the query to find "any text between two paragraph returns, no matter what tthe length", but I don't know how to do this.All the Wildcard options seem to find just one exampler (one digit, one character etc)

    And you came so far
    The operators for repeat are ? (zero or once), * (zero or more) and + (once or more). You can also specify exact numbers: {at least,up to}.
    All of these operators are "greedy" by default -- they will match as much as possible. To match as least as possible (which I'm sure you'll come up against, sooner or later), add another ? after the repeat expression.
    So this will find one digit, then optionally another (which will always be included):
    \d\d?
    and this one digit, then zero or as much as ten million million zillion:
    \d\d*
    which is functionally the same as
    \d+
    And this will find between 3 and 8 digits but will forced to use the shortest possible match:
    \d{3,8}?
    That said: A quick & dirty solution for your actual problem is to find any amount of digits, spaces, and comma's:
    ~b[\d, ]+~b
    (we need the plus here because otherwise it would also match an empty line). The [..] brackets an Inclusive list --- it will match any of the single codes inside.
    A more complicated but 'neater' way is to search very specifically only for number, comma, space, number sequences -- it's neater because that way malformed lines (comma without a space) will be skipped!
    (It also introduces another code -- the parentheses operators. Look them up in a good GREP reference --lost of people are enthousiastic about Peter Kahrel's O'Reilly title, because it's about using GREP in InDesign.)
    ~b\d+(, \d+)*~b

  • Microsoft Word API for Mac OS: Troubleshooting the Find/Replace function

    In my previous topic at
    http://discussions.apple.com/thread.jspa?threadID=2623068&tstart=0
    we found out the way to connect to the Ms-Word from Objective-C through ScriptingBridge.
    The connection works and the given text can be found and replaced using the method executeFindFindText: Although it generates exception and I am forced to put it in @try block and then continue with everything else in @catch.
    There is another, more important problem: the WordFind class does not seem to "give feedback" i.e. I could not find the way to programatically find out whether my find/replace was successfull, nor could I set WordFind object properties prior to running.
    The Class WordFind has many properties e.g.
    @property (copy) NSString *content; // Returns or sets the text in the find object.
    @property (readonly) BOOL found; // True if the search produces a match.
    @property BOOL matchWholeWord; // Returns or sets if the find operation locates only entire words and not text that's part of a larger word.
    I tried to set the property "matchWholeWord" or read the properties "found" and "content" but in vain.
    As I understand, the property "found" should be the key component in my process because it should
    return the BOOL value I need.
    What am I doing incorrectly? Any suggestions?
    Here is the final code:
    #import <Cocoa/Cocoa.h>
    #import "Word.h"
    int main(int argc, char * argv[])
    if(NSApplicationLoad())
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    wordApp=[SBApplication applicationWithBundleIdentifier:@"com.microsoft.Word"];
    if([wordApp isRunning])
    WordDocument *activeWordDoc=[wordApp activeDocument];
    WordTextRange *allTextRange=[activeWordDoc textObject];
    WordFind *findObj=[allTextRange findObject];
    NSString findText=@"FirstText";
    NSString *replaceText=@"SecondText";
    [findObj setMatchWholeWord:YES];
    NSLog(@"WholeWord: %i", [findObj matchWholeWord]);
    @try
    [findObj executeFindFindText:findText
    matchCase:NO
    matchWholeWord:NO
    matchWildcards:YES
    matchSoundsLike:NO
    matchAllWordForms:NO
    matchForward:YES
    wrapFind:WordE265FindContinue
    findFormat:NO
    replaceWith:replaceText
    replace:WordE273ReplaceAll];
    @catch(NSException * e){
    NSLog(@"Search Found:%i",[findObj found]);
    NSLog(@"Search Content:%@",[findObj content]);
    [pool drain];
    return 0;

    DavidMan wrote:
    So, what is your suggestion?
    Do it in pure AppleScript.
    Whom to complain? Microsoft or Apple?
    I'm not sure. All this stuff was new with Office 2008. It might work better with Office 2011. I would definitely ask on the Mac Office forum to see if anyone there knows any more: http://www.officeformac.com/productforums/

  • How can I remove all content between two tags using Find/Replace regular expressions?

    This one is driving me bonkers...  I'm relatively new to regular expressions, but I'm trying to get Dreamweaver to remove all content between two tags in an XML document.  For example, let's say I have the following XML:
    <custom>
    <![CDATA[<p>Some text</p>
    <p>Some more text</p>]]>
    </custom>
    I'd like to do a Find/Replace that produces:
    <custom>
    </custom>
    In essence, I'd like to strip all of the content between two tags.  Ideally, I'd like to know how to strip the CDATA content as well, to return the following:
    <custom>
    <![CDATA[]]>
    </custom>
    I'd much appreciate any suggestions on accomplishing this.
    Many thanks!

    Thanks much for your response.  I found David's article to be a little thin with respect to examples using quantifiers in coordination with the wildcard metacharacters; however, I was able to cobble together a working expression through trial and error using the information he presented.  For posterity, here’s the solution:
    Find:
    <custom>[\d\D]*?</custom>
    Replace:
    <custom>
    <![CDATA[]]>
    </custom>
    I believe this literally translates to:
    [] = find anything in this range/character class
    \d = find any digit character (i.e. any number)
    \D = find any non-digit character (i.e. anything except numbers)
    *? = match zero or more times, but as few times as possible (i.e. match multiple characters per instance, but only match one instance at a time, or none at all)
    I’m still not sure how to effectively utilize the . wildcard.  For example, the following expression will not find content that ends with a number:
    <custom>.*?[\D]*?</ custom >
    I'm presuming this is because numbers aren't included in the \D metacharacter; however, shouldn't numbers be picked up by the .*? expression?

  • Data Manager Find- Replace

    Can we do Find Replace in Data Manager, say on one field like street ?
    for eg: I want to find all the "Avenue" or "avenue" and replace them with Ave
    I know we can do it in Import manager, but is there a reason such functionality is not provided in data manager?
    I browsed thru data manager guide and see that the menu option edit->find/replace is enabled only on object tables???!!
    Can we achieve the same functionality through assignments?
    Any inputs/leads appreciated!
    -Sudhir

    you are right Varun,
    Using Import maps was what we did originally for address standardization,
    But Value Transformation is lost if you unmap the field and remap them.
    And thats what happened to us and we didn't quite check it!
    The Data Manager route which you and some others suggested will not work , atleast in my case because:
    if you noticed in data manager
    start a selection, with say one record
    -> Add another record to the selection , you know, using the shift key
    -> you will see the details pane highlighting the differences, so far so good
    -> for street , I will not see "only Avenue", because
    A) Avenue is part of a street
    B) And data manager will not exactly "tokenize" the differences
    C) for egL if I have two street values like " 120 pennsylvania Avenue" & "5th saks Avenue", detail pane will highlight them as two distinct values and I cannot change Avenue to Ave and get the Job done.
    most importantly...
    keep on adding more records to the selection...
    When you reach 10 records, notice the detail pane still lists all the 10 distinct street address side by side for street field
    Add on more record and make the selection 11
    then alll the fields in detail pane will turn to [..]
    So I can no more go in and replace Avenue , I have to replace the entire street value with watever I type in place of [..]
    So here is my question again:
    Why is there no functionality simple like Edit->Find-> Replace just like an excel interface, I am sure it is not technologically impossible, but rather is there something basic I am missing in wishing for such facility?
    -Sudhir

  • Spotlight not finding a simple textedit file

    Hi, I've looked at spotlight prefs and also gone into a Find window in finder and checked the basics are selected and yet spotlight still fails to find a simple textedit folder within Documents.
    I'm baffled
    Simon

    Hello Simon,
    Will it then be replaced automatically after some time?
    Yep.
    floba
    PS: If that doesn't work either, then I have even one more suggestion . "Open the Spotlight preference pane. Click on the Privacy tab, and then drag your hard drive to the list of locations you don’t want Spotlight to search. Wait a few seconds; then select the drive and click on the minus-sign (–) button. By adding the drive to this list, you force Spotlight to erase the index; when you remove it from the list, Spotlight notes that the drive is again available for indexing and starts chugging away at that task." (This tip was suggested at [macworld.com|http://www.macworld.com/article/132755/2008/04/spotlight1.html].)
    Message was edited by: floba

Maybe you are looking for