Grep Expressions

I am looking for grep expression and then one that is an exception to the grep expression. For example.  Acme (one font style and color) and the Boxes (USA) Inc. (another font style and color). And in some places I do not want the word Acme to conform to the grep expression within the document.

[ Grep something we could translate by "I don't understand anything!" ]

Similar Messages

  • Help building a grep expression

    hello,
    pls can someone help me build a grep expression for a dictionary:
    abcdef
    hjtoku
    yghmns
    I need an expression that would find in each word where the underline starts, and put, lets say, an asterisk there:
    abc*def
    hjto*ku
    ygh*mns
    thank you in advance!

    Underlines are a character attribute, not a glyph, so there's not a lot of complexity to this. To find underlined characters search for .+ and in the find format section set the basic character attributes to underlined. Understand that this will find underlined characters anywhere, even at the start of the word. If you don't want that it's a lot more complicated and I haven't figured it out myself, yet.
    To add the asterisk change to *$0
    This will add the asterisk, but it will also be underlined, so you need to run a second search for \* (you need to escape the asterisk character in the search field to find a literal *) with the underline attribute and change to nothing, but change the attribute in the change format to no underline, or if you wanted to remove the other underlines as well it could be done in the first step by removing the underline attribute in the change formatting.
    Peter Kahrel has a nifty script for chaining find/change queries to run in one step.

  • Need some help with GREP expressions

    I know--KNOW--there's a way to do this, but my GREP expressions keep failing.
    I want to add an em dash before any phrase that's in a paragraph style. So I obviously want the em dash to be in the location "beginning of paragraph." All my GREP searches keep failing. Can someone help?

    Adobe's implementation of "beginning of paragraph" is a tiny bit off from standard GREP (which, in itself, is less a set of hard & fast rules, but more like "guidelines"). Yes -- you can search for beginning of paragraph using plain ^, but you cannot use it with a replace operation.
    The trick is to give InDesign something to look for. Search for
    ^.
    (that's right -- one wildcard right after the start of a paragraph). You don't want to loose the character it finds, so replace with
    ~_$0
    where the first 2 codes is your em dash and the last 2 are "the entire found text". That's your original wildcard-found character!
    Don't forget to put your paragraph style in the Find Formatting box.
    This workaround works around the implementation failure, because you indeed want to add something to existing text. Unfortunately, another fairly standard GREP to look for empty paragraphs -- ^$ -- doesn't work, because then you have no place for a wildcard character ... (and yes, you can use a hard return \r instead of either first or last code, but then it won't work at beginning or end of story). It's one of those things I hope to see corrected with CS5.
    [Edit] Ha! Peter beat me to it but he made a typo. Besides, my story is longer.

  • GREP expression - find Title Case

    Hello all,
    ID CS4, Vista ultimate.
    I'm trying to make GREP expression to find all words that starts with the
    capital letter (like Italy, America, Europe, John, etc) and to mark them
    with the character style. This is the expression that I figure out:
    \<[A-Z]|[ÈÆ©®Ð]
    The problem is that this finds the words but select only first, capital
    letter and apply character style on this first letter but I want to apply
    character style on whole word (not just on "J" in "John" but to entire
    "John" word).
    Is there anyone who knows how to make GREP expression to find entire words
    that begin with the capital letter?
    Hope this make some sense.
    Thanks.
    -mirza

    A slightly more efficient way could be
    >\u\l+
    -- i.e., one uppercase character followed by one or more lowercase characters. That's with a few reservations, though:
    >\w
    is 'a
    i word
    character -- and that includes upper- as well as lowercase, digits, the hyphen, and perhaps some more characters. I don't know about the (C) and (R)'s (what are they doing there?).
    As a refinement on Peter's expression, though, there is no need to separate [A-Z] and [ÈÆ©®Ð] and then join them again using the OR | and parentheses. You can put everything inside the square brackets, as
    >[A-ZÈÆ©®Ð]
    means just that: A to Z
    i and
    the accented characters and (C), (R). Since you probably don't want to accidentally skip other accented characters (as the You Never Know Principle applies here), I'd suggest
    >[\u©®]

  • Need grep expression to change index page numbers

    I built an Index using Type&Tables>Index however there was a lot of additional work that had to be done manually after it was built, so I do not want to use the Replace command. Is there a grep expression I could use in Find Change to find the "tab + page number" and replace with "tab + page number adding 2" (i.e., so an item originally indexed to be on page 13 would then be indexed on page 15).

    Take a look at this thread:
    https://forums.adobe.com/thread/1282483
    Jongware's script should fit your needs without any modification, I guess..

  • GREP Expression for Varying Text

    I have an index in which I'd like to Find/Change all the entries with a character style, but stop the GREP expression before the tab, leader, page numb. They vary though. Here are 3 indexed examples:
    A16T-PVUNL-3
    A-100-90-3CT-300
    B-20-22-50-3/4 shank
    Is there any way to constrict this to just the characters and digits, then stopping before the tab? I achieved it in another index whose entries are 7-digits only with this expression: ^(\d+)
    The return constricted it so that search did not find the page numbers after the tabs.
    Thanks.

    http://help.adobe.com/en_US/indesign/cs/using/WSE33E49F9-94CE-4043-AA51-4761408A63F4a.html #WS6F1E524C-8F74-4331-A813-33D08F983E94 is the official help page.
    You'll find a bunch of other resources listed here: http://community.adobe.com/help/search.html?searchterm=Nested+Styles&q=Nested+Styles&lbl=i ndesign_product_adobelr&x=0&y=0&area=0&lr=en_US&hl=en_US

  • GREP Expression Needed

    I'm reposting this here, hoping some genius scripters will know more than the designers ---
    I've scoured the websites and have been trying to figure out the correct GREP expression for what I'm trying to achieve, but to no avail, so alas I am posting this in hopes of ending my misery.
    I want to add an italic character style to the names of Naval ships (USS xxx xxx) in my book.  I want to italicize the name, but not the 'USS'. Any ideas?
    Thanks a million.
    ~Laurie

    Here you go (needed a break). Write the names in a text file, one name per line, and save it in the scripts folder using the name uss_names.txt. The first line in that file must be the name of the character style you want to use. If that style doesn't exist, the script creates it.
    Peter
    if (app.documents.length == 0) exit ();
    // Read the text file
    ship_names = get_list ();
    // Create character style if necessary
    if (app.documents[0].characterStyles.item (ship_names[0]) == null)
        app.documents[0].characterStyles.add ({name: ship_names[0]});
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.changeGrepPreferences.appliedCharacterStyle = app.documents[0].characterStyles.item (ship_names[0]);
    for (i = 1; i < ship_names.length; i++)
        app.findGrepPreferences.findWhat = "(?<=USS\\s)" + ship_names[i];
        app.documents[0].changeGrep ()
    function get_list ()
        var f = File (app.scriptPreferences.scriptsFolder + "/uss_names.txt");
        if (f.exists)
            f.open ("r");
            var temp = f.read ()
            f.close ();
            return temp.split (/[\n\r]/);
        else
            alert ("Can't find uss_names.txt.");
            exit ();

  • How to create an InDesign Grep Expression to specific words

    I have a long list of congratulations wishes all following a certain pattern. How can I create a grep style with the following sequence:
    Congratulations to [name] upon.....
    The first two words of the paragraph are always: Congratulations to
    Followed by: name
    Followed by: upon.... (then continues with the rest of info)
    There's a general paragraph style to the paragraph, let's call that "body". A  character style, let's call "bold", should be applied to the first word, then skip the word "to", apply the "bold" character style again to the name (however long that may be), and stop at the word "upon". Keep in mind that the word "to" is mentioned again later on, so I wouldn't want to use an expression with all words "to", unless can be specified only the first instance.
    I'm new to GREP, but have figured out so far that the following will give me the applied character style to the first word: ^Congratulations
    Thanks a lot in advance to whoever can help me out here.

    Fabulous guys! Thanks Eugene and Peter. It works great. All I did was add the "nested style > apply to first word" to get the first word bold. I greatly appreciate your assistance.
    One more scenario that I need to get done, if you don't mind. Thanks.
    This one is quite similar, but a bit different:
    Congratulations to [name] son of [names] upon....
    The first two words of the paragraph are always: Congratulations to
    Followed by: name
    Followed by: son of
    Followed by: name
    Followed by: upon.... (then continues with the rest of info)
    Similar as before, but now I need both names [after the word "to" and after the words "son of"] to have the style applied, in addition to the word "Congratulations".
    Thanks for your help.

  • GREP Expression help

    I am new to using GREP and have a find/replace scenario that I'm having trouble with. I have a list of names with middle initials, but no period. I'd like to find the capital middle initial and replace it with the found text, plus a period. I have previously been able to find the middle initial by searching for a space, then any uppercase letter, followed by another space. The problem come in the replace. When I replace with the found text, it adds the space that was found after the capital letter before the period that I am trying to insert. How can express this so that it looks for the space after the capital for the find, but in the replace, puts the space behind the period?

    Hi,
    Search:  (?<=\s)\u(?=\s)
    Replace: $0.
    Or, I suppose you play in this way:
    Search (\s)(\u)(\s)
    Replace: \s$2.\s
    Or:
    Search \s(\u)\s
    Replace: \s$1.\s

  • Seeking help with GREP expression

    I am working with InDesign's GREP feature for the first time. I'm learning the codes but I'm still pretty lost. I'd appreciate some assistance creating an expression.
    The document is a test. I'd like to reflow each question onto it's own page.
    The individual questions look more or less like this:
    LM_CC1234
    ■13»Solorrovit ipietum voluptium fugit, am, si ame.¶
    Olenisquia dis etur rem quia dollenis maximus est?¶
    A»plicius perovit¶
    B»alit ducit fugia¶
    C»vel invel ius¶
    D»offic tem aboriae¶
    I'm open to different possibilities, but right now I'm trying to search for the spot that's either 11 or 12 characters (including line breaks) before the square dingbat (hexadecimal x25A0). The LM_CC1234 identifier sometimes uses a format with one more letter (like SLM_CC1224) hence the 11 or 12 character count.
    Once InDesign has found the spot, I want to insert a carriage return (hexadecimal xD) in that spot throughout the document.
    Thank you for your time!

    Hi,
    Did you consider startParagraph property to use?
    If      LM_CC1234
    or     LM_CC1234
            ■13»Solorrovit ipietum voluptium fugit, am, si ame.¶
    are separate paragraphs -- this option could be set to StartParagraph.NEXT_PAGE,
    so no GREP needed here.
    hope...

  • Need GREP expression to Find MD., PhD., FAAC. etc. but not at the end of sentence

    I'm just starting to utiilize GREP a little and was trying to write an expression the would find two or more uppercase or uppercase, lowercase, uppercase combination followed by a period such as MD., Phd., FAAC. etc. I'm attempting to to find those instances and remove the period so that it reads MD, PhD, FAAC etc.
    I came up with (\u\u|\u\l\u+)\. which works OK except that it also finds anything with 2-3 uppercase letters at the end of a sentence as well, which I dont' want.
    I also used $1 in the change to box to capture the phrases which seems to work fine as well.
    I would really just like to not find anything at the end of a sentence.
    Maybe something with lookahead or lookbehind. That's confusing me as well.
    Thanks for any help in advance.

    pixxel schubser:
    Great idea. Here is a sample of the text. I need to eliminate all the periods after the Titles but leave the commas if they are there but I don't want to remove the periods if they happen to appear at the end of sentence. Hope this is clearer. Thank you all for helping out.
    d.
    Author(s):
    Erik Wissner, MD., FACC
    Sebastian Deiss, MD.
    Tilman Maurer, MD.
    Michael Botros, MD.
    Karl-Heinz Kuck, MD., PhD., FACC
    Introduction | Objectives:
    Catheter ablation of atrial fibrillation (AF) using magnetic navigation is feasible with similar long-term success rates, but typically more time-consuming than manual ablation. The 3. generation magnetic navigation system (EPOCH, Stereotaxis Inc., St. Louis, MI) allows for improved catheter response times potentially shortening procedure duration. We compared procedural data using the EPOCH system with previously published data from our laboratory using the 2. generation system for catheter ablation of AF.
    Methods:
    Catheter ablation of atrial fibrillation (AF) using magnetic navigation is feasible with similar long-term success rates, but typically more time-consuming than manual ablation. The 3. generation magnetic navigation system (EPOCH, Stereotaxis Inc., St. Louis, MI) allows for improved catheter response times potentially shortening procedure duration. We compared procedural data using the EPOCH system with previously published data from our laboratory using the 2. generation system for catheter ablation of AF.

  • Grep expression question

    So, I'm new to this....
    I'm trying to write an expression that will look for any digits or words that appear in parenthesis at the end of a paragraph and then change it to... deleted.
    Don't laugh but this is what I came up with and it's not working
    \([\d\w]\)
    What do I need to do?

    Yeah, but that's just because you keep on changing what you want to find!
    \([-\w/]+\)$
    -- add the hyphen as the first element, so ID won't think you mean 'from .. to'.
    The uppercase \u is not necessary because this is included in \w 'all word characters'.

  • Is there a script,Can automatically perform multiple grep expression?

    For Example,I have 5 grep,they are a.xml,b.xml,c.xml,d.xml,e.xml.
    Usually,I need execute 5 times.
    A script can once finish the 5 Grep?
    Thank you~

    Hello,
    Have a look at XStrings.
    http://www.kerntiff.co.uk/free-stuff/xchange-strings-xstrings
    The script can perform multiple greps, finds, and can run a script file.
    Best.
    P.

  • Grep expression for specific search within Brackets

    Hello,
    I did a search and found many topics for searching within brackets, but wasn't able to find anything to search for specific characters/quotation within brackets.
    Note: The forum image uploader wasn't working for me so I embedded it to the topic. Hopefully it shows up for you. (http://cl.ly/1H42302P2x3c1Q3P2a42)
    For the Brackets and words within, i use:     (\[).+?(\])
    and have it them to a different font.
    For my project i need the quotations to be a different color and nothing else.
    These are the ones i'm trying to add to an expression:      '|"|;|,
    Any help is very much appreciated. I've been trying many arrangements with no luck. Thanks!

    It's not possible to search for your punctuation inside parentheses only. (FYI, that needs a positive lookbehind of variable length, and that's not possible.)
    But the hint to get it done is right there:
    function(){return A.apply(null,[this].concat($A(arguments)))}
    For the Brackets and words within, i use:     (\[).+?(\])
    and have it them to a different font.
    Simply search for your set
    only in that particular font.

  • GREP expression to remove trailing zeros?

    Hi,
    I have to find and change multiple entries of trailing zeros. Please find sample below to understand type entries need to be change.
    1.00              -> 1
    0.01200         -> 0.12
    4.50              -> 4.5
    0.0040           -> 0.004
    Please help me how can i use grep to find and change in CS6
    Thanks in Advance.
    Sanjay

    Peter,
    Right! In 3 steps (text in black)
    1/ Exclusion if no decimal part:
    Find: ,?(?<![\.\d])(\d+)(?![\.\d])
    Replace: color X
    2/ Treatment:
    Find: (?<=[\.\d])\.?0+(?=\s)
    Search Format: color black
    Replace: nothing
    3/ Treatment:
    Search Format: color X
    Replace Format: color black
    Seems to work. To be validated! 

Maybe you are looking for

  • Error (Short Dump) while posting any Material document

    Hello All Experts, I am facing an error (short dump) while doing all material document related transactions (for example MIGO,MB1A etc) . I am getting the below message:- Short text of error message: Document number 1000 5000000000 2009 was already a

  • How to create Report group in GR55

    Hi gurus, I have to create new report group for special purpose ledger for getting report in GR55 please assist me how to create the new report group? Initiatives are highly appreciated and rewards with points. Regards Chandra

  • How can I tell if a Graphics object has been disposed

    Any ideas? Thanks

  • FCP to Color previous post method?

    I'm about to send a 50 min project into color for the first time (had a play around in it a few times before to familiarize myself with it a bit more) Would the method at the bottom of the thread below be a good way to go about sending a project from

  • Error in SQL Code

    Hi, My below code works fine if i execute it... SELECT A.cno ,      B.inceptiondate      FROM A LEFT OUTER JOIN select TRIM(cno) cno,      max(inceptiondate) inception_date      FROM [email protected] group by cno)B ON A.cno=B.cno AND A.inceptiondate