How to end grep styles?

Grep styles (in Paragraph style) is one of the fabulous option in indesign CS4, but i am having one doubt that do we have any option to end grep style at any particular instant like we have "END NESTED STYLE HERE" to end nested style.

You should state the full string to match in your GREP query. If it matches all, then all gets marked. If you don't want it to match all, you need to adjust the GREP query.
Alternatively, if you feel you have to "prematurely end" your character style, you can use a nested style instead.

Similar Messages

  • CS4: How to load GREP styles from CS3?

    I imagine there must be a way to get my many custom GREP searches into CS4, but I know not how. Anyone know?
    Thanks in advance,
    Aaron

    Go to your InDesign CS3 Preferences folder (in Home > Library > Preferences > Adobe InDesign > Version 5.0) and you'll find a folder called Find-Change Queries. In there will be a GREP folder with your saved custom searches. Each saved search is a small .xml file.
    Copy those XML files and then paste them into the same place for your CS4 Preferences: Home > Library > Preferences > Adobe InDesign > Version 6.0 > en_US > Find-Change Queries > GREP.
    You don't need to quit out of either program to do this, as soon as yo paste in the GREP files they'll appear as options in the Find/Change dialog box.
    AM

  • Grep Styles/Nested Styles from the end of the paragraph

    Hi -
    It appears that grep styles, and nested styles only allow you to apply styles from the beginning of the paragraph until the match.
    I'd like to be able to apply styles from the END of the paragraph going back.
    This would allow me to apply a non-breaking character style to the end of a paragraph to control "runts". You could make the last two words of a paragraph non breaking, or set a 15 character threshold.
    This wouldn't work for all cases, but I'm working with centered, non-justified text, so it should work fine. If the feature were there.
    I'm sure there are other things one could do with it as well.
    There's a good discussion, and a MANUAL work-around on
    http://pdsassoc.com/tipsCS/DeruntingParagraphs/index.html
    Tom

    I used your suggestion and reviewed the tutorial again.
    Sometimes a missing piece of info drives you nuts.
    Thanks again.
    My clients will love this enhancement.
    CS rocks.

  • How do I apply a grep style to the plus (+) sign?

    I was able to apply a grep style to the minus and equal sign, but not the plus sign "+".  It appears the plus sign means 'apply to all' in the grep style box.  Can some assist me with this? Thanks in advance.

    Thank you. It worked perfectly.

  • How can I apply a GREP style to a text variable?

    Hello everybody,
    I have a question concerning GREP styles inside Paragraph styles.
    1. I've created a text variable to generate a recurring title on the upper side of the page based on the main title paragraph style;
    2. The recurring title is in Adobe Garamond Small Caps, all letters in lower case, and it is formatted with a paragraph style sheet in the master page;
    3. I want to create a GREP style for the recurring title, according to which every time that in the recurring title appear an apostrophe or the double quotes, they are automatically lowered 2pt on the baseline
    (I already created the character style sheet that lowers letters of 2pt).
    What I need is the correct GREP formula to automatically apply the character style sheet to apostrophes and double quotes, in the line of text generated by the text variable...
    Thanks for your  help
    p.

    Hi,
    As I said, using Power Headers is the best way to do it.
    As Power Headers treats the header as "live text", you can use a simple grep style inserted in the header para style:
    … to obtain:
    For the sample, I use a char style named "-2pts" with Shift -5 pts and Green color to show you the place of ' and ".
    Don't forget that, even Power Headers treats the header as "live text", you only have to update Power Headers to make an update of the headers! 
    Even I use in another cases Tomaxxi's [JS] and it's a good way to treat the question, Jean-Claude Tremblay's solution is less interesting because the variable used is converted in text. If the variable text content changes, it's more complicated to manage the update!

  • Apply grep style only once

    I can't get my brain around what is probably a very simple problem: I want a paragraph style that applies boldfacing to any character up to an including the first colon in a paragraph. If I used  a nested style "through 1 :" the whole graf is bold if there is no colon. So that's out.
    A grep style ".+: " seems to work in most cases, but if there's a second colon, the boldfacing is extended to that point. What I think I want is a grep style that works "zero or 1 times" but I cannot figure out how to use the ? to make that happen.

    @Jongware – I think Robert wants to limit the GREP style to the first line of a paragraph.
    But unfortunately GREP in InDesign does not know about line endings.
    In scripting we could do something like what he wants, but comes with some obstacles, because the GREP will apply a character style, that will probably change the line ending. A very dynamic situation…
    Example 1
    Basic situation:
    This is my text here comes the colon: and
    here another one: that Robert don't like
    to take into account using the GREP style.
    Formatted after  the GREP style is applied:
    This is my text here comes the colon: and
    here another one: that Robert don't like
    to take into account using the GREP style.
    As I understand it, in case that the first colon will leave line one, only the first line should be formatted like this:
    (Case 1)
    This is my text here comes the first
    colon: and here another one: that
    Robert don't like to take into account
    using the GREP style.
    Or should it be, that the style should only be applied, if it's in the first line?
    (Case 2):
    This is my text here comes the first
    colon: and here another one: that
    Robert don't like to take into account
    using the GREP style.
    But what, if the colon in the basic case is at the end of line 1 and will be shifted to line 2 after formatting?
    What should happen then?
    That is simply not possible to format automatically (dynamically) using GREP styles in InDesign.
    Uwe

  • Grep Styles

    How to change this two lines formatted with Bold, regular and italic, and change it to all bold in Grep Style.
    I need to do it several times, but how to get the right script in grep to find Bold face at the beginning then a tab
    then a regular 11 pts and return plus tab and italic text in parenthesis, see example below:
    P. 1.  ¿Cuán cierta y segura será la segunda venida de Cristo? 
             (Hebreos 9:28)

    Probably not a candidate for a GREP style. GREP styles are used to apply character styles to text matching the Query string. This looks, at least to me, as if you want to apply a paragraph style. You could maybe use a find/change GREP query to do that, but you can't base it on multiple formatting, only the pattern in the text itself.
    Right now, if I had to guess, I would say there is a paragraph style applied that uses either a numbered list (can you select the P.1. ?) and a nested style, or two nested styles to make the page number bold and the verse italic. If that's the case, you might be able to just re-define the style.
    Do you really want to remove the italics, or make them bold italics? Do all the paragraphs start with P. and a digit or digits and end at the closing parenthesis?

  • IDCS5/MAC - GREP Style to uppercase a letter after a dash between words

    G'day there.
    I'm trying to create a GREP style to uppercase a letter after a dash between words, more specifically where one word starts with a capital and the one after a dash does not e.g. Lorem-ipsum = Lorem-Ipsum
    The full story is that there is a standing indesign file used over and over again which data-merges surnames which are in a massive database. The data arrives in uppercase and our mail barcoding software allows us to Title Case certain fields, but the Title Case behaviour has the following results:
    * McLeod = Mcleod
    * D'Agostino = D'agostino
    * Smith-Bunting = Smith-bunting
    i've been able to solve the McLeod = Mcleod problem with the following GREP style:
    (?<=Mc)\l
    and then apply a character style which is nothing more than All Caps.
    similarly, i've been able to solve the D'Agostino = D'agostino problem:
    (?<=\u')\l
    and once again apply the All Caps style to the affected letter. This also solves the O'leary problem to O'Leary.
    However, when I try these GREPs to grab the Smith-bunting style issues:
    (?<=\u\l+?-)\l     or   (?<=\u\l{2,}-)\l
    the search won't work, nor will it work with regular Find/Change GREP replace... yet the expression \u\l+?-\l will find the block that i'm after.
    I could use the search
    (?<=\l-)\l
    and this will find Smith-bunting = Smith-Bunting... but will also find co-operate = co-Operate (will find two words joined with a dash but  starts with a lower case letter).
    This is fine if the para style is applied to the  line in the address block containing the client's name, but if the name is referred to in a block of text, then that block of text has to have the para style with the GREP style applied, and any dashes between words in that para behave the same way as the name.
    yes, it is possible to go into excel and use the =PROPER(affected cell) and fix the Smith-Bunting fields, but i'm trying to create a solution which will work solely in InDesign so that other operators in the office (who aren't familiar with excel) can simply open the standing file and dump in the txt database generated by the mail barcoding software.
    there are other names that the mail barcoding's title-case fouls up i.e.
    * MacLeod = Macleod
    * van der Graaf = Van Der Graaf
    * van Diemen = Van Diemen
    but a GREP to make Macleod become MacLeod may foul up Mack, Mackie or Macy to become MacK, MacKie or MacY.
    I also know that a GREP for the van der or van won't work as the style will only force letters to become All Caps, not uppercase to lower...
    Ultimately...
    does anyone know a way to GREP style (not a find/change GREP) a fix for Xxxxx-xxxxx = Xxxxx-Xxxxx?
    Colly
    Colecandoo.

    I agree with Haakenlid on his Dirty-Workaround view -- I feel data should be entered the way it oguht to, not altered by some magic GREP styling -- but then again I can also sympathize with your POV re: a fire-and-forget solution even your dumbest operator can't miss.
    Oh the rigors of life.
    If you are totally, absolutely certain you want to do this by GREP, use this:
    (a) Set a To Capitals character style to the string
    \b\u\l+\-\l
    -- this will magically transform "Hon. Lt. Sir John Forsythe Blunt-object" into "BLUNT-Object".
    (b) Then override ( ! ) the first half again with another character style that removes the To Capitals attribute ( ! ):
    \b\u\l+-(?=\l)
    Notice how this expression is exactly the same as the above one, except for the very last code -- the next lowercase must also be caught, but now using a lookahead so its formatting won't be affected.
    This removes the All Caps override from the first halve, changing it from "BLUNT-Object" back to "Blunt-Object".
    Lots of side effects, I'm sure. Perhaps it is safer to teach your operators to run a single script.

  • Finding "End Nested Style Here" option

    Hi,
    How to find and replace the "End Nested Style Here" marker through InDesign CS3-JS.
    Thanks,
    P. Ramkumar

    If you use findText, you can find it using ^h
    In findGrep it is ~h
    Dave

  • Create a GREP-Style with script? [AS] [CS4]

    Hi
    I'm trying to ad a grep-style to a paragraph style.
    It's easy to read/write properties from one that already exists but how can I create a new one?
    This is in applescript, CS4
    rgds /Mattias

    Yep, know about Nested Grep Style.
    In AS it:s http://www.indesignscriptingreference.com/CS4/AppleScript/nested-grep-style.htm
    If I have a P-style in a document, with a nested grep style applied. I can read and write to that grep style by calling it:
    nested grep style 1 of paragraph style "myParaStyle"
    read: grep expression of ... -- -- -- -- -- -- -- Where ... is the above line
    write: set grep expression of ... to "xyz"
    However, if the P-style doesn't have a nested grep style applied, I can't find a way to create/insert one into the P-style.

  • Attempting to create a GREP Style

    I'm trying to make a GREP style for one of my paragraph styles, that will take the text from the beginning of a line until a colon and set a character style to it to bold that part.
    Example:
    Step 1: Take bread
    Step 2: Take peanut butter
    Step 3: Spread peanut butter on bread
    I don't think I've been getting the syntax right.  I've put ^\:~h and ^:~h into the 'to text' box, thinking this meant "Beginning of line until the character ':' and end" but neither of those have given me the results I want.  Thanks in advance for the help!

    Prismatus wrote:
    Your response worked for me.  I had tried using a wildcard before the ones I posted, but only put the . in, assuming it would cover more than just one character.  I assume the +? covers all characters until the colon shows up, yes?
    No, it's slightly more complicated than that (sorry!). By default, GREP is Greedy -- that means, if you use this
    ^.+:
    GREP will think that the Any Character wildcard may be repeated as much as possible (that's the '+') before it needs to match the colon. What this means is that it will work just as you expected for
    Step 1: This is a single line.
    but will go out of its mind with this
    Step 2: what will happen now? Well, contrary to what you were expecting, the entire line will be marked bold, all because everything up to the very last : will be matched!
    The bold bits accurately shows what happens! Another example would be this:
    \d+
    which for a string of "123" will not match just the first digit, then the second, then the third, but all of them in a single long go. By default, GREP will grab as much as it possibly can.
    Adding a question mark behind the "Repeat Me" character reverts this behavior to Non-Greedy behavior, and as such GREP will match as little as humanly possible:
    \d+?
    will then match just the "1" in "123".
    Prismatus wrote:
    I also like the be literal part, but I was wondering what you would have instead of \d if you had more than nine steps, or if you had substeps (1a, 1b, etc.).
    That's just a case of adding more specifiers. To match one or more digits, you need this:
    ^Step \d+:
    The '+', again, will allow a repetition of the "digit" code. In this case you don't have to add a question mark, because there is no way this could run out of control; first, it will only match digits, and second, these digits must be followed by a colon.
    And if you may or may not have a single lowercase character following the digit (but still before the colon), you'd use the Any Lowercase Character code and the Zero or Once repetition specifier:
    ^Step \d+\l?:
    (that's a lowercase ell.) You see the question mark meaning Something Entirely Different here? It's only a Non-Greedy marker when immediately following another repetition code, one of these
    * (zero or more)
    + (once or more)
    ? (zero or once)
    {4,8} (or any other set of numbers -- this is at least 4 and at most 8 times)
    Uh, by the way, that makes this
    abc??
    a valid GREP. It will match "ab" or "abc", and then always select the shortest possible match of these two, which is then the "ab" one. ... Uh. I'm pretty sure this may be useful, some time in the future.

  • Creating a GREP style Help Needed

    I would like to set-up a style using GREP expression(s) that would do the following:
    Everything preceding an em dash (including the em dash and two spaces after the em dash) would be set to bold-italic, AND everything in the paragraph that begins with the word "NOTE:" until the end of the paragraph would be regular-italic.
    Here is a sample of the kind of text I want to format with one style:
    OPERATOR PANEL - The operator panel is located on the right-hand electrical enclosure. NOTE: Not all equipment will have the same operator panel. Refer to schematics for additional information.
    "OPERATOR PANEL - " would be all bold (or bold italic). The body text is regular. the "NOTE: Not all .... " to the end would be regular-italic.
    Any help or direction to a web-site with examples would be appreciated.
    Thanks in advance.
    RPP

    It's easier than you think.
    Peter's suggestion of a regular nesting style might work, except that it's
    i always
    applied to each paragraph you apply it to. That's just what the Grep styles are for:
    i conditional
    stuff.
    The 1st half: Apply Style: Bolded To Text: ^.*? ~=
    (there should be another space after the '=')
    The 2nd half: Apply Style: Italicized To Text: NOTE:.*$
    These are both pretty much basic GREP expressions -- except for the "~=", that's Adobe's --, so just about any google to a GREP repository can explain them. I already knew the basics, but
    this page taught me some new tricks.

  • CS5 - Grep style problems

    Where I work the treatment of the type is to reduce the size of all-caps, a string of numbers, or a combination of the two. For years they've been doing it by setting up a Character Style for each Paragraph Style (e.g., "Body smaller" for "Body), and then also alternate Character Styles if the text already has a Character Style applied to it ("Body Red Italic smaller" for "Body Red Italic"). You can imagine this quickly becomes a lot of styles.
    So I thought with CS5 Grep styles I could set this up in the Paragraph Styles. I want the Grep style to apply a Character Style that is nothing but a Horizontal and Vertical scale of 95%.
    The types of things I'm wanting Grep to find are below. But I'm only wanting to apply the style to the letters and numbers and not the punctuation.
    AAA
    B23
    33,333
    4,444,444
    U.S.A.
    (ABC-1)
    I went at writing this a piece at time, so it is not very elegant. Here's what I have:
    \d{2,}|\u{2,}|\u+\d+|\d+\u+|\d+[[:punct:]]\d+|\u+[[:punct:]]\u+|\u+[[:punct:]]\d+|\d+[[:pu nct:]]\u+
    This does a pretty good job, with a couple of problems.
    1) It is "catching" (applying the character style) to the first punctuation if there is a single character before it (e.g. the first piece of punctuation in 4,444,444 and U.S.A.)
    2) It is not always "catching" instances where there are more than three sets of numbers/caps in an item (e.g. U.S.A., it doesn't style the "A"). I know Grep is probably just doing what I'm telling it to do, but I can't see how to fix it.
    I would appreciate any help anyone could give me.
    Thanks.
    Tom

    You can't do all this in one GREP style. The one you came up with is already difficult to read, so you can imagine what happens to its readability by the time you get it to work. Apart from that I don't think it's possible to do what you want in one expression.
    So you really need to split up your task into several chunks, all of which you can then add to the same paragraph style. Your expressions may be more efficient, but they're much eaier to understand and maintain. Here goes.
    The easy ones are AAA, B23, and (ABC-1), all of which are captured by this expression:
    \(?\u[-\u\d]+\)?
    U.S.A. is more tricky, and it needs to be split in two itself. The first part captures series capital+period, but not the last one:
    \u(?=\.\u)
    Capturing the last capital+period is interesting in that it requires a negative lookahead embedded in a positive lookahead, which I wouldn't have thought was possible, but it works:
    (?<=\.)\u(?=\.(?!\u))
    For the numbers you's do something similar.
    Peter

  • GREP STYLE, find/change

    Hi!
    My problem is..
    I got these numbers:
    17
    31.9
    32.9
    15
    in a table/cells. They need to have an .00 and 0 like this:
    17.00
    31.90
    32.90
    15.00
    I can use this one for that: find: .$  change: $0.00 but then the numbers with 31.9 gets the .00 also.. 31.9.00
    Any grep styles for that? multiple functions in the same style`?

    A grep style can't change text for you; it can only apply a style to text that matches whatever pattern you set.
    I don't think there any one search/replace that will get you where you want to go, but I was able to do it using two search and replace strings:
    ^\d+(?!\.)\b
    $0.00
    Finds any number of digits at the beginning of a line, that does NOT have a period following it, and returns the same number with ".00" appended.
    ^\d+\.\d\b
    $00
    Finds the remaining instances that have a period and only one digit after it, replaces it with the found text with "0" appended.
    This will not touch anything that has a number that has two digits after the period, like 12.95.
    Give it a try on a copy of your document, see if it does what you need. Depending on how your document is set up, and what other text is in it, you might also want to highlight the table (or just the relevant columns) and restrict the search to the selection rather than the whole document.

  • Nested Line Style affecting my GREP style

    Hello all.
    I'm formatting a large book at the moment and am trying out a "runt fixer" to prevent bad sentence breaks in columns. So far I have created a character style that only applies the "no-break" attribute, and have two GREP styles - one looking for a space and 8 characters or less before a full-stop, exclamation mark or question mark; and another looking for the 8 characters or less then a space after a full-stop, exclamation point or question mark. The codes are:
    \s.{1,8}[.!?]
    and
    (?<=[.?!]\s).{1,8}\s
    It works... nearly. It has issues when fullstops are used in numbers such as displaying currency, dates... but largely works for the text.
    The problem occurs when I go to the Drop Caps and Nested Styles feature, and use the "New Line Style" - in this instance it was used at the beginning of chapters to make the first line smallcaps. Instead, something strange happened to the second GREP style - it no longer worked.
    In case I'm not explaining myself properly, i've uploaded a sample of what is going on here: https://dl.dropboxusercontent.com/u/55743036/runt-issue.idml
    The first page is OK, but the second page displays the fault. I've colorised the GREPs so that it is clear what is not breaking at the end of a sentence and what is not breaking at the start of a sentence.
    Has anyone experienced this before or can tell me what is going on? it is my error or is it a bug?
    Colin

    @Colin – I thought, I could make it work, if I introduce another GREP Style BEFORE the one that is not working: A GREP Style, that is doing nothing (applying the character style "[None]" to a character like "§" that is simply not in the text. Did not work.
    Another attempt with InDesign CS5.5 OSX 10.6.8: I made a new paragraph style BASED ON the one that is not working. Changed nothing in that new one, just let it be based on the not working one.
    Now: THAT IS FINALLY WORKING! But in a different way I expected…
    "Will work" is based on "not working".
    Here all GREP Styles used in "Will work":
    Uwe

Maybe you are looking for