Indesign Grep style question

Hello,
I have a question about Indesign. I want to make the text after a certain character like a hair space for instance bold. This must be set in a paragraph style. I think this can be done with GREP styles. I have tried several things but it doesn't make sense to me.. Does anybody know if this can be done or is there a better way to do this?
Thanks!

Apply 'bold' character style to text:
(?<=~|).

Similar Messages

  • Indesign crashes when editing GREP styles

    I'm using Indesign CS6 on a mac.  I have GREP styles applied to a certain paragraph style, and every time I go in to try and edit the GREP styles, ID crashes.  I have another, completely separate file, which also uses GREP styles, but so far hasn't had a problem with me editing them.  I tried the suggested solution of exporting to .idml and recreating the file, but when I try to open the idml file, ID crashes again.  Is my best option to clear my preferences?  Is there anything else I can try?

    It's when I try to edit any of the four GREP styles I have applied to that paragraph style.  If I try to edit GREP styles for any of my other paragraph styles, ID handles it fine.  I made a new paragraph style that was identical to the troublesome one (just by applying the same styles, not by duplicating it), and without any GREP styles.  When I went to delete the old one and replace it with the new one, ID crashed again.  So it sounds as though this paragraph style is what is causing the problem, but I can't seem to get rid of it.

  • 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

  • Using GREP styles for changing characters and colors

    Hello everybody,
    I have a question regarding GREP styles. I wish to change each letter of an alphabet in text to a square in a different color. For example: every 'a' in the text change to a yellow ■. I thought GREP styles would be perfect for it so I went to find/change, typed in my requests and InDesign told me it has found no 'a' in my text, which isn't possible. How do I fix it? And the other thing- is it possible to change the color of ■ ? Because i couldn't find the option.
    Please excuse me my incompetence, I am a new user of InDesign.
    Thanks in advance for your help! : )

    First off, it sounds like you want to use find/change with GREP, which is fine, rather than a GREP style, which is part of a paragraph style definition and cannot change the text in any way other than apply a character style to the found string, so would not help here.
    The not finding the text makes me think you've limited the search parameters in some way, either by limiting the scope to a selection, or by including a style or format requirement in the find options, perhaps.
    In order to do this, I think you are going to need to make use of the "other" category in the change dropdown and select Formatted Contents of Clipboard (which should clue you in that you need to make one of your colored squares and copy it to the clipboard before you run Find/Change). You can do this with either a plain text query or a GREP query, and there is no advantage to GREP in this case unless you want to match several different things and apply the same clipboard content to any of them.
    You'll need to run a separate find/change for each colored square. It might be possible to script a chain so it runs in a single operation, but that would also require swapping the colored sqaures on the clipboard which complicates things in this case. You might want to ask over in scripting: InDesign Scripting

  • 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.

  • 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!

  • A GREP style not holding in CS4

    Hi,
    OK...I have been playing with a bunch of these GREP searches in CS4 where I can put them in as a stylesheet.
    I have a character style that is called superscript, that automatically makes a ® superscript when it is typed, and that is working fine.
    Then I added my lookahead for any TM or ® to add a 100 tracking in between the letter and the tm or ®. It does it if I have the type in the box and apply my style to the whole box. But, if I go in and make changes to the text, the ®-superscript automatically happens when I type a new one, but the tracking doesn't automatically happen. What's worse is, if I select the text and try to apply the style manually, it still doesn't not apply the 100 tracking. I have to make it a basic or none style and then re-apply the good one.
    If it is in the GREP style of the paragraph style, shouldn't it do it dynamically?
    Here is my image.
    thanks!!
    babs

    The only object I know of you can create an InDesign and specify whether it prints or not in the PDF is a button. That would definitely NOT work with character styles.

  • 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.

  • 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

  • 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.

  • Grep styles and bullet points

    Is there a way of using GREP styles to insert bullet points on text after a specific heading has been detected?
    I am working on a brochure where many of the pages will have a features section, so am reluctant to manually overide paragraph styles. The "FEATURES:" heading will always stay the same, the text within the bullet points will change.
    At the moment I have the following layout...
    FEATURES:
    test1
    test2
    test3
    test4
    What I am hoping to achieve is this...
    FEATURES:
    test1
    test2
    test3
    test4
    I haven't used GREP styles before but from looking round it seems the most obvious feature to use, so if anyone has an alternate solution that'd be great.

    Header should be a paragraph style on it's own.
    Use a hard return not a soft return for a new paragraph http://indesignsecrets.com/dos-and-donts-of-text-in-indesign.php
    Bullet should be a separate paragraph style.
    Apply that style to only bullets
    Set a Character Style for your Bullets, which can be applied through the Bullet paragraph style.

  • Lost GREP styles

    I had created a whole liste of GREP-styles and suddenly I realize they have all disappeared. Perhaps this happened when synchronizing the parameters, or by installing Indesign 2014. Does someone know where the user-created GREP-styles are stored? I could try to get them via my Time Machine.

    GREP styles are document-level attributes that you should be able to load from a previous document. Saved GREP queries for Find?Change, however, are stored as part of the user preferences. You should find a folder named Find-Change Queries in your profile or library in the same path where the InDesign Defaults preference file is stored for each version. You can copy the entire folder to a new version, or only selected queries. for more information, see Replace Your Preferences

  • Grep Styles - Conflicting - "^" not working in lookbehind and more

    Hi,
    Still fighting my way in the jungle of paragraph grep styles.
    In InDesign CS5 by the way.
    I import text from DB and they all come in the same.
    I need to use the same paragraph style to all paragraphs.
    I really don't want to use find-change since that would mess up the xml holding the data.
    Example-text explanation:
    • All sizes are separated by ", - "
    • …… = tab
    • Not all rows have tab
    • Sizes can be both numeric, letters, contain "/" and "-" and """ and " " (space) and yes indeed a "," comma!! (and every other idiotic combination you culd think of.)
    • When only 2 posts in a row - should be separated by a ", " = (Comma-space)
    • When more than 2 posts i a row - all posts but first and last should be hidden and separated by " - " (space-dash-space)
    I have tried numerous combinations to get them all but they always conflict with each other.
    Bugger!
    I really shouldn't be impossible.
    Is it possible in Paragraph grep styles to "catch" "any character but these" and kind of make a character-set like [!not this character]   (= [!a|b|c]  )
    Is it possible to count the number of posts in a row? ( like... if more than 2 then hide...bla bla)
    All sizes are separated by the same ", - " and sometimes I want to hide them, and somtimes I want to use one of them...
    Is there any kind of "if-else" thing that can be used??
    My original idea was to be able to catch them by using ^-combinations for beginning of paragraph and matching with tha linebreak and tab but it seems as if that don't always work when using positive or negative look-behind-ahead.
    Oh, I'm blabbering. Sorry.
    Any hints or pointers would be greatly appreciated.
    /K
    A) Got this - Original text
    Same text but this is my Goal!
    134/140, - 146/152, - 158/164……….299,-
    134/140, - 146/152……….299,-
    38, - 40, - 42, - 44, - 46……….399,-
    38, - 40……….399,-
    XS, - S, - M, - L, - XL……….399,-
    XS, - S, - M, - L
    XS, - M
    XS, - S, - M, - L, - XL……….399,-
    B 70, - 75, - 80, - 90, - 95……….199,-
    B 70, - 75……….199,-
    Medium-Wide 17”, - 17,5”……….995,-
    Normal, - X-Wide……….999,-
    16 mm 95, - 105, - 115, - 125, - 135, - 145…......99,-
    16 mm 95, - 105……....99,-
    134/140 - 158/164……….299,-
    134/140, 146/152……….299,-
    38 - 46……….399,-
    38, 40……….399,-
    XS - XL……….399,-
    XS - L
    XS, M
    XS - XL……….399,-
    B 70 - 95……….199,-
    B 70, 75……….199,-
    Medium-Wide 17”, 17,5”……….995,-
    Normal, X-Wide……….999,-
    16 mm 95 - 145…......99,-
    16 mm 95, 105……....99,-
    GrepStyle
    Result wanted
    ,\s(?<=,\s)-\s.+(?=\s-)
    Red undelined text will be hidden
    (Got this)
    134/140, - 146/152, - 158/164……….299,-
    134/140, - 146/152……….299,-
    38, - 40, - 42, - 44, - 46……….399,-
    38, - 40……….399,-
    XS, - S, - M, - L, - XL……….399,-
    XS, - S, - M, - L
    XS, - M
    XS, - S, - M, - L, - XL……….399,-
    B 70, - 75, - 80, - 90, - 95……….199,-
    B 70, - 75……….199,-
    Medium-Wide 17”, - 17,5”……….995,-
    Normal, - X-Wide……….999,-
    16 mm 95, - 105, - 115, - 125, - 135, - 145…......99,-
    16 mm 95, - 105……....99,-
    Need this to not conflict with other grep
    blue underlined text needs to be hidden.
    134/140, - 146/152, - 158/164……….299,-
    134/140, - 146/152……….299,-
    38, - 40, - 42, - 44, - 46……….399,-
    38, - 40……….399,-
    XS, - S, - M, - L, - XL……….399,-
    XS, - S, - M, - L
    XS, - M
    XS, - S, - M, - L, - XL……….399,-
    B 70, - 75, - 80, - 90, - 95……….199,-
    B 70, - 75……….199,-
    Medium-Wide 17”, - 17,5”……….995,-
    Normal, - X-Wide……….999,-
    16 mm 95, - 105, - 115, - 125, - 135, - 145…......99,-
    16 mm 95, - 105……....99,-

    There are error messages in the errorconsole.<br>
    Firefox ignores the css rules because there is a syntax error at line 18:<br>
    -->> table.heading {{background-image:url('barline.jpg');<br>
    please remove one of the opening brackets here<br>
    You can go to Mozilla Developer Network to learn CSS.<br>
    https://developer.mozilla.org/en-US/learn/css<br>

  • GREP style for one specific paragraph

    Hi all,
    I'm faced with the following problem in a textdocument I've got to rework in InDesign.
    The text is based on 3 'groups' of information. First there is a title, beginning with:
    "1.1. Title (so two digits and a paragraph),
    a body text,
    and a source, starting with: 'source: This is the source' and
    '*: this is the source'.
    Now I want all paragraphs starting with two digits in the same style, and all lines starting with 'Source' or '*' in the same style.
    I'm pretty new with GREP, but I believe that might be the solution. Or any other ideas to to this fast and automated?
    Is there a code that specifies a style for a whole paragraph?
    All help is very much appreciated since this is a very laaaarge document.
    Thanks!

    GREP styles (which you seem to think of) only apply character styles. So that's out for entire paragraphs.
    woutergeeftvorm wrote:
    Now I want all paragraphs starting with two digits in the same style, and all lines starting with 'Source' or '*' in the same style.
    Select all text and assign it your Body text paragraph style. Then use this in the Find/Replace dialog, GREP section. Find:
    ^\d+\.\d+
    Replace: leave blank, but select the name of the title style in the Change To formatting fiend.
    Press Change All. Done.

  • Grep style positive look behind

    I am trying to create a grep style in InDesign CC 2014 to make anything after an em space a certain character style. I have come up with
    (?<=~m[[:punct:]]\l\u\s)*?
    but it doesn't work. Must contain punctuation, spaces and words.
    Any suggestions would be appreciated.

    The correct look-behind for the em space would be (?<=~m) and what you want to find goes outside of that. (?<=~m).+ will find everything after an em space up to the end of the paragraph. (?<=~m)\S+ will find up to the next white space (so the first word following the em space). (?<=~m)[^~m]+ will find everything following an em space up to the next em space.
    It's not really clear to me what you are trying to do here. It's also not clear why you think you need a GREP style rather than a simple nested style.

Maybe you are looking for