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?

Similar Messages

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

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

  • Why not there a "Find/replace in Grep style" inside the Para style?

    Whenever I type a digit in my text, it should be colored red as per style. I do this by grep style inside the para style, but now I need to insert brackets before and after of the digit(s), i realize that there is no replace option in grep style in the para style. Why not it be there a "find/replace" instead "find" only as it now appears?

    Ya, this is simple, finding a specific para style with digit and change them, when the book in first pass. But while in the correction pass of the same book, whenever we are inserting more text into the document, there are chances to be unaware of the digit style that, it should be surrounded by brackets, and it happened earlier so I have a thought of it. Again, while paginating a book having more than 350 - 600 pages, and 3 to 4 guys working in it, I think this may work.
    Expecting your valuable comment on this.
    Thangaraj Mohan.

  • Grep style to remove space in table cells?

    CS5.5
    I am working on an annual report - lots of tables, and for some reason a space appears before the content of everty text cell. (Left-over from Excel).
    I have tried to define a Grep style to remove the space at first in every cell.
    Can you help me define a Grep style to prevent I am having pains in my arm?
    BR Nina Storm

    You can't use a GREP style to remove anything, but you could do this with a GREP search.
    If it's just one space, use this:
    Find ^
    (in the formula above, type a space after the ^)
    replace with nothing
    This will find any single space at the beginning of a paragraph and remove it.

  • Why doesn't Grep Styles with pos lookbehind work?

    Hi,
    I've posted another thread but I suppose I expected too much. I'll try to siplify this.
    I have text where I want to catch underlined text:
    Ponny, - Cob…….499,-
    125, - 135, - 145, - 155…….399,-
    140, - 150, - 160, - 170……..99,-
    140, - 150………99,-
    This paragraph grep style works for the above:      ^\w+,\s-\s
    However, when I want to use positive look-behind to just catch the " - " it stops working.
    I have tried the following (none of them catches anything at all):
    ^(?<=\w+,)\s-\s
    (?<=^\w+,)\s-\s
    (?<=\w+,)\s-\s
    Is there a limitation as to what syntax I can use in the lookbehind?
    Pointers anyone?
    /K

    Hi Eugene,
    Lookaheads and Lookbehinds don't work when using the repeat codes, like "+" or "*" or "?" etc.
    I guessed there might be a limitation as to what works.
    Eugene Tyson wrote:
    Can you search for
    \s-\s
    And only search for underlined text in the
    Find Format
    area
    No, sorry. The underline was olnly to indicate what I was trying to grep...
    I don't want to use find-replace. I want to use the paragraph grep style.
    /K

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

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

  • GREP styles vs style sheets

    I've got a lull at work and decided to work on my list and start to learn GREP so that I can use GREP styles.
    The first one is a simple one:  [[A-Z][A-Z]\S+?] This finds anything inside the brackets that starts with two capital letters. I know it works because I can find "[MT2]" in Find/Change.
    OK, so I try it in some ID cs5 text with my first GREP style. It's failing the vast majority of the time. So I try lots of different things to see if I can find a pattern of what works and what doesn't. I've tried just the local formatting of a lone 'graf. I've tried making character and 'graf style sheets that incorporate a GREP style with the new character style, say "change type color to green".
    I've looked through the forums and don't see others with my problem so it must be something about me or my document. I've used other documents to eliminate that variable. I've gone through the tutorials and David Blatner's stuff and don't see anything I'm doing differently.
    When I format some text with a character and 'graf style sheet, it fails. BUT when I change the character style sheet of the source text to "[None]" it works. I've tried starting with text that is '[None]' and a 'graf style sheet of Normal, it works.
    But starting with text styled with '[None]' character and a formal 'graf style sheet with a GREP Style, it fails. But when I change the 'graf style sheet to ]'Basic Paragraph]' it works.
    I'm trying to find a pattern here, so to speak, and the only thing that has a chance to succeed is setting the character style sheet to 'None.' I just don't see than anyone who uses GREP styles has any problems like I do.
    What do you reckon I'm overlooking? I've spent today trying to find what works and doesn't. As it is, I can't recommend this to my co-workers.

    Rule of thumb for applying styles is basic formats for the entire paragraph should be defined in the paragraph style. If some selected bit of text needs to be formatted differnently, then you apply a character style (or, if you must, a local formatting override). With Nested Styles and GREP styles, ID has very powerful tools for applying character styles to selected text WITHIN the confines of the paragraph style definition. Most programs don't have that capability.
    Should you apply the character syle as a nested or GREP style, or perhaps through Find/Change, or just by manually selecting text and applying the style? The answer to that will depend on a few variables. Should the particular string ALWAYS have a particular set of attributes, no matter what? Find/Change or local selection is the way to go. Character styles applied that way will survive even if the underlying paragraph style is changed to match the character style, then changed again. If the style should be applied to a string in a particular position in a paragraph, even if that position might move around a bit, a nested style is probably the way to go. If you want to make changes to text that matches a particular pattern, wherever it falls, when the surrounding text is a particular style, a GREP style is the answer.
    GREP styles are very powerful, but they also use far more in terms of resources than applying a character style using other methods. I've seen reoprts of ID getting bogged down by too many GREP styles.

  • 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:
    (?<=~|).

  • 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

  • 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

Maybe you are looking for

  • 6/4/2014 - Beta - Flash Player 14.0.0.126

    The latest Flash Player 14 builds are now available.  You can download Flash Player here:http://www.adobe.com/go/flashplayerbeta. Please note that this build is identical (except for version number) with the official release slated for next week.  Pl

  • Playback problems on one single project

    I'm having problems getting a project to playback on my external monitor. I just tested another project and it played back fine, so it must be the project. Ack! Any suggestions?

  • Contact Pictures

    I see there is a small space for a picture of the contact in the Contacts vCard on the iPod. How do you add a photo to the vCard, and what size in pixels is generally recomended? I'm using Microsoft Outlook to put the vCards together.

  • Lock entries

    hi gurus How to open the lock entries without using sm12 . Is ther any setting in plant level. thx

  • How long will an iPad 4 play music whem powered by 2600mAh Flash Chargers for Mobile Devices

    how many hours will an iPad 4 play audio when it is powered by a 2600mAh Flash Chargers for Mobile Devices ?