Grep to find double dot

Hi,
Any one can help me to find double dot in a indesign document.
It should not catch triple dot(...) and six dots(......) match

Here's a screen shot:
I colored single dots blue, and the single-character ellipsis red. I've placed them in several combinations. When I run the GREP, here's what it finds:
As you can see, it only found the single dots, and not the ellipses. Are you saying that you have actual ellipses and single dots, but it isn't finding the single dots when they are after an ellipsis?

Similar Messages

  • Grep to find first occurrence of a particular word in a story

    Hello Grepers
    I haven't had luck working out a Grep to find first / last occurrence of a particular word in a story.
    To find the first occurrence of the word hello in a paragraph I would use this grep.
    (Hello(?!=Hello*$))
    For the last this works.
    ((?=Hello(?=.*Hello)))|(Hello(?!=Hello*$))
    I have tried single line and multiline prefixes but they don't do the trick.
    Waiting in suspence,
    Trevor

    Hi Marc,
    Thanks for your reply, I'm glad you got my subtle hints.
    1) First Hello in the paragraph(s)
    Marc Autret wrote:
    Also, it seems to me that the GREP patterns you've posted are wrong and only work by accident. For example:
    (Hello(?!=Hello*$))
    actually means: find 'Hello' if and only if the match is not followed by '=Hell' and 'o' zero or more times and an EOL.
    Well Marc I made a Hell of a mistake!!!
    I meant to write (Hello(?!=Hello.*$)) with a dot there which at least is not quite as stupid if not more correct.
    In fact both (Hello(?!=$)) without a . and Hello(?!=^) work, well sort of work for the first Hello of the paragraph(s) depending on the were one start the search from (before the first Hello works otherwise it will find the next "first" Hello of the paragraph.
    I said sort of because I naively presumed that GREP styles would work like GREPS, dumb hey.
    I was really looking to use these GREPS in GREP styles, well you can't.
    In a GREP style
    (Hello(?!=$)) or any of its variants will apply the style to all occurrences of Hello in the paragraph.
    I can partially circumvent this problem by adding a second GREP STYLE which applies an anti style to all words after the first Hello (?<=Hello).*
    i.e. I have a want my first Hello to be bolded then set the first style for bold and the second to regular.
    This however is not practical if one wants to auto style more than one word in this way in other words to do the same for the first Hi and the first Hello in the paragraph.
    As a regular GREP solution providing that one starts the GREP search before the first occurrence of Hello It will work.
    2 & 4) First and Last Hello in the story
    Again these GREPs don't work using GREP styles, this I think is because GREP paragraph styles only look within the one paragraph at a time they are applied to.  So they can't look at the preceding or following paragraphs to see if they contain Hello or not.
    If I am correct I see no work around to this and am will to pay 10 Pounds, Euros or Dollars to whoever comes up with a non-script fully functional  GREP styles solution for this (I think my money's safe)
    Regarding the regular non styled GREPs they nearly work as stated.
    When (?s)(Hello)(?!.*?\1) is used to find the last occurrence of Hello in the story, if the find tab is used it will firstly find the last Hello of the story then it will go back and find the one before that!! then it will go onto the next story.
    Using the GREP in script works as stated.
    The easiest way of course to find the first and last Hello in a story, document etc. by script would be
    app.findGrepPreferences.findWhat = Hello"
    myFinds = myWhatEver.findGrep();
    First occurrence   myFinds[0], last occurrence   myFinds[-1].
    HOWEVER NOT PARTICULARLY EFFICIENT!
    3) Last occurrence  of Hello in paragraph.
    This one works perfectly both with regular GREPS and GREP styles.
    In summary
    GREP STYLES: only the (Hello)(?!.*?\1) last Hello in the paragraph GREP works.
    GREP FIND TAB: the first Hello in the paragraph GREP finds the first Hello after the cursor, the first in the story works in the limited way as written, last in story has the problem of finding the second last Hello after finding the last Hello, Last in paragraph works flawlessly.
    GREP SCRIPTING: all work without problem except for the first Hello in the story that has the problem of needing to extract the last 5 letters which for my automatic text / GREP changer is a bit of a problem but for general scripting would not be problematic.
    Once again Marc thanks for your input, I doubt there's much if anything  to add on the topic maybe Laurent Tournie from indigrep.com might have some ideas.  I don't know his contact details so if you think it's a good idea please can you send him a tweet / mail.
    Regards
    Trevor

  • 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

  • Find/Change Grep only finds one instance per paragraph, where am I going wrong?

    Hi,
    I've been using a Find/Change Grep to find any price with a comma and change that comma to a thin space (Newspaper's editorial style).
    But the Grep only finds the first instance of this per paragraph.
    Sample text...
    "$200,000 $200,000 $200,000.
    text at start of paragraph $200,000
    $200,000 text at end of paragraph
    tab     $200,000."
    In the sample the grep would miss the second and third price on the first line.
    I've been using...
    Find...
    (?<=\$)(\d{3})\,?(\d{3})
    also tried (\$\d{3})\,?(\d{3})
    Change to...
    $1~<$2
    Is there anything I can add to find these last two prices?
    I've been using this in combination with Batch Find Replace script, so different greps are set up for 5,6 and 7 digit numbers that start with $.
    Thanks.

    Try this,
    Find what: (?<=\x{0024})(\d{3})\,?(\d{3})
    Change to: $1~<$2
    Vandy

  • Double dot in file from mail sender channel

    Dear All,
    I have a volatile problem in mail channel with receiving xml file as attachment.
    The flow is: Mail with attached XML file (ORDER05 in xml format) --> XI  --> Idoc
    Sometime, may be for one percent of mails, mapping receives from channel double dots in fields with quantity(1..000 instead of 1.000). If I resend the same mail again, it is processed without errors.
    Have somebody faced with such problem? What can be decision of this problem?
    I've recreated communication channel - it didn't help.
    Thank you in advance
    Lev

    Dear Prateek,
    Looking at payload after channel I see double dot and same picture in RWB and in SXMB_MONI. I can see right payload only in the mail, which I receive on my own mail address (as CC). If I resend this mail from my Outlook address, channel work properly.
    But this problem appear rarely, may be in one percent cases and only with mail from one particular vendor. The same channel is used for 3 vendors.
    I don't use custom modules in channel, only 2 standard modules:
    localejbs/AF_Modules/PayloadSwapBean
    localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
    Regards
    Lev

  • Is there a way to find doubles in iPhoto

    Is there a way to find doubles in iPhoto ?
    Very hard to manage all the photos. Many times there is the same photo, and it takes disk space for nothing.
    George

    There are two apps, actually one app and one Applescript script, for finding and removing duplicate photos from iPhoto. They are:
    Duplicate Annihilator
    iPhoto AppleScript to Remove Duplicates - free
    The script only identifies the duplicates and leaves deleteing them up to you.  Duplicate Annihilator will identify and move the dulicates to the Trash for you.  It'll still be up to you to empty the trash bin.
    OT

  • GetHashCode to find Doubles; Can you do it better?

    Hi guys!
    Last month i post a code of mine(The Full Code is here:
    http://social.technet.microsoft.com/Forums/it-IT/7acea85b-1d48-4b14-bd97-45c0603c8d64/powershell-basta-usare-un-po-di-logica-xd?forum=benvenutiofftopicit#365d668d-9ea6-4f72-8360-11ec7602f5b0)
    The goal of this code is find Doubles but it use MD5 Hash:
    $md5Hash = [System.Security.Cryptography.MD5]::Create()
    $hashBytes = $md5Hash.ComputeHash($bytes)
    but it takes a lot of time...
    How can i search double faster?
    Thanks
    A

    OMG!
    i understand now what you mean!
    $childFiles have only one element...
    I know that
    $childDirs=$sourceDir.GetDirectories('*',[System.IO.SearchOption]::AllDirectories)
    give me all directories like Dir $source -recurse
    How can i obtain all the files? $sourceDir.getfiles('*',[System.IO.SearchOption]::AllFiles
    or maybe $sourceDir.GetFileSystemInfos() ???
    Thanks!!!

  • Find doubles function does not work in address book

    I had about 40 doubles in address book.
    I choose the function 'find doubles'
    It didn't find the doubles so I had to remove them manually.
    Has this happened to you?

    Try the steps I posted here: https://discussions.apple.com/thread/3222240

  • Regular Expression - find double hyphens only

    I am wondering if there's a way to write a regular expression to find double hyphens and change them to single hyphens.  The catch is that some of the text I'm searching through have multiple hyphens.
    Example:
    str1 = "Here is my sample text with double -- and I would like to replace this with one hyphen."
    str2 = "Here is another sample with multiple hyphens ----- that I do not want to change but leave as is."
    Is there a way to change only str1 to a single hyphen and keep str2 as is?

    You are correct.  I should have been more explict.  Here are some real examples.  I hope this helps.
    Helps what?
    Have you tried to write the regex yourself, at least?
    Adam

  • How can I find double photos in iPhoto'11?

    Hey, how can I find double photos in iPhoto'11? Only know that it displays doublets when I use the import function in iPhoto'11.
    Thanks
    Matthias

    Thanks for the answer.  After I posted this question, I saw there were other discussions.  I do see everything is there, but it is time comsuming to view each individual picture to make sure I put it in the right catagory!!
    I did send feedback to apple,  but I see people have been asking them to fix this problem for the last 7 months or so, and it is still not fixed.....so what is good about the new version!!? 

  • Pattern Matching find double quate problem

    Hi all,
    I have below coding:
                Boolean isFind = false;
                Pattern pQuate = Pattern.compile("^{[\"]}");
                Matcher mQuate = pQuate.matcher(groupTwo);
                if (mQuate.find())
                  System.out.println("Find Double Quate");
                  isFind=true;;
                }The groupTwo contain value either start with character or ", the groupTwo actually get from another pattern matching group(2) which convert for example {filename="apple"} or {filename=apple}.
    I need to check whether the string value is start with double quate or not.
    but my coding got error! How to solve this?
    rgds,
    bryan

    Hi i have a problem in regex find method ...
    when i hardcode the value everything works fine but when i take it form a file
    the regex fails.. plz let me what is the problem
    thanks in advance
    private int locRegExp(String regExpStr){ //check current with previous section whether feature changed
         // RtfSection section=null;
         int j=currentsect;
         try{
         // private static String regExpStr=regExpStr1;
         // String regExpStr=".+@.+\\.[a-z]+";
         for(;j<data.size();j++){
              Pattern pat1;
              pat1 = Pattern.compile((String)regExpStr);
              // System.out.println("reg exp "+regExpStr);
         //     pat = Pattern.compile(regExpStr.toLowerCase().trim());
         String content=((RtfSection)data.get(j)).content;
         if(content==null||content.trim().equals(""))
              continue;
         // System.out.println(content);
         Matcher matcher = pat1.matcher(content);
         //System.out.println(content);
         // matcher.reset(content);
         boolean result=matcher.find();
         //System.out.println("regex see "+result);
         if(result){
         System.out.println("Found the match "+matcher.group());
              break;
         }}catch(Exception e){
              System.out.println("am at regex "+e);
         return j;
         }

  • GREP to find two left double-quote marks in a row?

    I'm usually pretty good with regexp, but this one is eluding me. I'd like to find a left quote ~{ followed by any number of characters -except- a right quote ~}, followed by aother left quote ~{. It should match a string like (using `` for the left quote):
    ``The rain in Spain, ``she said.
    But not match:
    ``The rain in Spain,'' she said, ``falls.''
    Thanks for the help!
    Perry
    KidPub Press

    What do you want to accomplish? Do you want to change straight apostrophes into typographic apostrophes?
    If it is this what you intent, do following:
    In the preferences activate typographic apostrophes, in the dictionary part select each language and put the correct apostrophe.
    In the document take care that your paragraph styles have the correct language (and also the character styles)
    In GREP change " to ". (Eg. in German it would change a "text" to „text”, but also «text» to „text”.

  • GREP to find string of quotes

    I have some strange "strings" of quotes for which I need to search where there are consecutive single and double quotes with nothing between them. So "'"'Wording here.'"' More here."
    Can GREP be used to find a string of quotes that might consist of any number or combination of single and double quotes? The string would consist of either all open or all close quotes but could be any combination of double and single, starting or ending with double or single.
    Thanks,
    Ken

    SRiegel wrote:
    ['"]+
    (that's a single and a double quote inside the brackets) If you do this with typographer's quotes turned on [..]
    For the finding part, there is no need to toggle smart quotes off or on. For example, a single ' will find all three variants, whereas ~[ will only match curly open, ~] curly closed, and ~' only straight ones.
    Other than that, yeah, you want to make sure anyway Curly Quotes is active for the replacements.

  • Text or Grep in Find.change script by list?

    Would like to use the grep formating in this query (instead of text) but the script shows error:
    text {findWhat:" )"} {changeTo:")"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
    Why here coexist two ways of writing?
    How to decide?

    @Laurent: heh heh. After that long story I was still paying attention to the original question...
    Mariana:
    ... as this can combine more characters in a search, for example finding space before point, period, semicolon, etc. Or space after ( or before)...
    Yes, that's possible with GREP. Try this for the first one:
    grep {findWhat:" ([.,:;])"} {changeTo:"$1"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Remove space before period et al.
    (Remember the script needs TABS between the sections, as in the original file.)
    This one is a bit challenging. Actually, the period is a special character in GREp (it stands for "any character"), so normally you would need to escape it:
    (space)\.
    to search for a space followed by a period. However, the square brackets [...] define an OR group, and that removes the magic properties from the period. Apparently, there is no use for a wildcard character in an OR group! (That would be something like, "The following characters are allowed: a comma, a colon, any at all, a semi-colon ...")
    There is a more advanced way to remove spaces like these. You want to look for spaces which are followed by any of these characters, and replace them with nothing. That would be
    {findWhat:" (?=[.,:;])"} {changeTo:""}
    You can try this in the interface to see it works.
    The second can be done using the Unicode value for an ellipsis ("\x{2026}" -- another notation than in the regular Text find), or with the special escape code "~e". Yup -- there is another escape character. The backslash is used by GREP itself, but GREP does not understand InDesign's own special characters -- page breaks, smart single and double quotes, Indent-To-Here, em dashes, and a few others. They can also be inserted from the menu on the right side of the Find field. These characters need a tilde, so InDesign can "translate" them internally to something GREP can use, and GREP never sees them. Since the tilde is nothing special for Javascript, you can safely insert only one in the script data file ...
    To remove a space before or after an ellipsis, you could use this:
    grep {findWhat:" ?~e ?"} {changeTo:"~e"}
    ... but in this case it may again be simpler to stick to regular text mode (where you would use "^e" for the ellipsis, by the way).

  • GREP for finding wrong facing apostrophes/quote marks?

    I have this one set up
    (?<=\w)((~[|~{))
    But I'm not 100% convinced
    What I really want to search for is
    any double quote at the start of a word/sentence - but don't include it in the search
    Ignore any text
    Find the left quote or left apostrophe
    I was doing this
    .+?(\>(~{|~[)
    But that was selecting the text before it
    I just want to select the Apostrophe or the Quote marks.

    What do you want to accomplish? Do you want to change straight apostrophes into typographic apostrophes?
    If it is this what you intent, do following:
    In the preferences activate typographic apostrophes, in the dictionary part select each language and put the correct apostrophe.
    In the document take care that your paragraph styles have the correct language (and also the character styles)
    In GREP change " to ". (Eg. in German it would change a "text" to „text”, but also «text» to „text”.

Maybe you are looking for