GREP style allows text in square brackets

I'm just starting to understand some ways that I can use GREP in the messy confusion of the documents that I have to work here, so patient with me...

We have a load of technical writers here who do not necessarily have a lot of experience InDesign, but be used to enter text. A text must be "BOLD" to attract the attention of the end user, so I thought I could use GREPs for apply a bold style to certain words and phrases that occur in any of the documents. Such a forum is intended for users to renew the clips or bolts or similar, so I did what I think is a GREP which finds 'renew' and applies to every word between it and a return or a period (but exclude the word "renewed", because the other permutations that follows):

renew (?.) Ed.*?). +(\.| \r)

That works very well in most places. But I fell on cases where there is an image reference in parentheses after the occurrences of 'renew' in places (such as "you must renew the clips (see figure 6)'") and I would like to exclude the media and their content of style. But as a beginner, I had a little if bogged down hit brick walls trying to find ways to do it. Can anyone offer a suggestion?

Thanks for any help.

Doug, you use GREP (to find and replace) or GREP Styles? (by your description of what it does)

If GREP Styles:

1 no need to use (\. | \r) at the end GREP Styles automatically stop at the end of each paragraph.

2. no need to use (?) Ed.*?) a simple (?.) ED) is enough here, as long as this corresponds to what didn't really matter if / what follows.

Try it shorter:

renew (?.) ED) [^ ()] +

-This text makes bold to 'renew' and the end of the paragraph * or * up to the first parenthesis.

Tags: InDesign

Similar Questions

  • GREP: Find several paragraphs in square brackets

    Attempts to write a grep which finds the text, including paragraph breaks, bracketed tags [EXT.] and [/EXT].  It looks like this:

    Int hillestisite militam dolupta corera seque nonsers perrum aut aut aut por and and man re dolut dolorio

    [EXT] m doluptae dolorem idebit pa dolendit, optassi mendae optam labor sita consecum

    New era, its dolessim rehenisquam conem etum nihil con pos eatem odit ratis orenim and inveni officati undi reium faccae dolupti acienetur ipistio. Pienistecae n [/EXT]

    [EXT] onsed and aliciae plabor aut mos that tem nobis Theon denihil latusantin anagement recte explaborem ent quist, solest, omniendaecto bersperro dolest, sam autatur, tiossit ab imuscia epernature and alitatuscia volupta volene who niendant that not only

    atiassit, and dolent of res ditati pa, cum estis eatempo rerovid nis volecu elenis

    mquam quo eumet quis voles dollantium dolupta a doloriori officilis mintior entini quo eost my ea doluptiorro unt quidi

    quibus one and fugiatibus excepuditi utecus moditatem atemoditia doluptat dolum haecceity consequ cus res doluptibus arum fu [/EXT]

    GA. Nam quis minullor adignita soluptias Abdellatif sit quam quis am vendiciis alit eliq ero

    Here's my formula:

    \[Ext](.+\r.+)+-[/EXT]

    It is the second set of brackets, with several paragraph breaks, but you won't find the first game, one with only a single paragraph break.

    Any ideas?

    Thank you!

    It's as simple as the last one.

    Try this:

    \[EXT\][^\]]+\[\/EXT\]
    

    Hope that helps.

    --

    Marijan (tomaxxi)

    http://tomaxxi.com

  • Shortcuts to place the text in square brackets

    Is there a script to place the bracketed text in Indesign? I have a lot of text where some words should be placed in brackets and would like to just highlight the word and use a shortcut to put in brackets.

    You can also consider this. It will avoid having to carefully select the text and simply place the brackets after the last word of the selection (or even just a text cursor blinking) and before the first word:

    s = app.selection [0];

    s.Words [-1] .insertionPoints [-1] = .silence '] ";

    s.Words [0] .insertionPoints [0] = .silence '['; '.

  • grep for format of the numbers in square brackets]

    Hello, I have quotes in the text that appear in the ground [1] or [1-3] or [1, 3-5, 4: 7-10]. I want to use the blue color for the numbers in the model but all (, or-) else remains black. I use this grep ((?<=[\[]))([[:digit:]]+(,\s|-)) * [[: digit:]] + qui me donne une couleur bleue pour chaque chose.) How can I just blue numbers?

    Thank you.

    Why?

    It does not matter.

    It would be easy with Grep find & replace. But it is very difficult to do with Grep styles (without seeing the entire document). In this case, I can only give you the Grep styles:

    It is perhaps useful to you.

    Have fun

  • Questions to copy text, including GREP styles

    Hello.

    I have a block of text, which contains text formatted with styles, and a particular style by contains a GREP style, making a certain word "BOLD" and colored.

    When I copy this document to a new document that does not contain the styles, paragraph styles are made, but the character GREP style is not fired.

    If the character style in the receiving document, then all is good.

    Is this normal? I was expecting the character style that is attached to the paragraph style to be included automatically in the target document.

    Is there a way to get around this? I want to make it as perfect as possible, but for now I need to make sure that I have loaded before as I have paste the character style.

    See you soon


    Roy

    It should not. Try trashing the prefs - see replace your preferences

  • Is it possible that the text Variables can be sensitive GREP style?

    I grep styles defined within a paragraph style and they apply to everything correctly except for one repetitive text variables?

    Is this a limitation of the software?

    Yes, the composition engine handles all conent of the variable as a single character. For the same reason the content of a variable cannot break and crushed to two lines.

  • InDesign: Help with Grep Styles (do not always work)

    I found this excellent tutorial which allows styles GREP simulate the functionality of the HTML tags.

    So that the cat sat on the Mat < /b > < b > will appear in InDesign as: the cat sat on the Mat.

    The problem is that this does not always work.

    Here I have two text elements that are displayed on pages separated into separate text boxes. Both have the same paragraph style applied to them (who use the technical HTML GREP)

    < b > "Make fool me super fast, birthday card from Jonathan!" < /b > add Ben.

    Holly wand Glitters and brushes lift into the air.

    "It works!" shouts Holly and Ben.

    < b > "Humpy, lumpy, bumpy, do."

    Nice and comfortable King thistle. "< /b >

    "Thank you, you can go now."

    Nanny Plum,' said King thistle.

    The first paragraph works perfectly. The < b > tags are hidden and the bold character style is applied.

    Paragraph 2 does not work. The < b > tags are hidden, but the characters are not "BOLD".

    This could be the cause?

    Here is my code GREP:

    Apply the Style HTML to text: (< \/*b >)

    Apply bold to the text: (< b >). + (< /b >)

    (Style HTML is used to hide the HTML characters. "Style"BOLD"makes"BOLD").

    Thanks for any help that can be offered

    Is there a paragraph return after 'make '? You can check by turning on the view-> display-> Normal Mode and then Type-> display hidden characters (not sure on the last of them, my phone isn't InDesign on it).

    GREP styles may cover several paragraphs. So if the opening tag "BOLD" is in one paragraph, and the closing tag is in the second paragraph, it'll never work.

  • GREP style sheets styles vs

    I've had a lull at work and decided to work on my list and start learning the GREP so that I could use GREP styles.

    The first is a simple one: [[A - Z] [A - Z] \S+?] He finds something inside the brackets that begin with two capital letters. I know it works because I can find no "[MT2]" in find/replace.

    OK, so I try in a text of cs5 ID with my first GREP style. It fails to the vast majority of the time. So I try a lot of different things to see if I can find a model of what works and what does not. I tried just the local formatting of a solitary ' graf. I tried to make character and "stylesheets graf incorporate a GREP style with the new character style, for example"change color in green type".

    I've looked through the forums and can't see any others with my problem there must be something about me or my document. I used other documents to eliminate this variable. I went through tutorials and stuff to David Blatner and don't see anything I'm doing differently.

    When I format text to character and "graf stylesheet, it fails. BUT when I change the stylesheet of the text source "[None]" characters it works. I tried from text which is "[None]" and a ' graf normal style sheet, it works.

    But from text styled with "[None]" character and official "graf stylesheet with a GREP Style, it fails. But when I change the "[graf stylesheet to] [' standard paragraph]' it works."

    I'll try to find a model here, so to speak, and the only thing that has a chance to succeed attaches the stylesheet of character to 'None '. I don't see that anyone using GREP styles is having problems as I do.

    What do you I'm dominant? I spent today trying to find what works and does not work. As it is, I can't recommend it to my co-workers.

    Golden rule to apply styles is the Basic for all of paragraph formats should be defined in the paragraph style. If some bit of text should be in the format differnently then you apply a character style (or, if you must, a substitution of local formatting). With the nested Styles and GREP, ID has very powerful tools to apply character styles to text selected in the paragraph style definition. Most of the programs do not have this capacity.

    If you apply the syle of character as a nested or style may find/replace, or just GREP in manually by selecting the text and using the style? The answer will depend on a few variables. The particular string must ALWAYS have a particular attribute set, what happens? Find/replace or local selection is the way to go. Applied character styles this way will survive even if the underlying paragraph style is changed to match the style of character, then again changed. If the style should be applied to a string in a particular position in a paragraph, even if this position can move a bit, a nested style is probably the way to go. If you want to make changes to the text that corresponds to a particular model, whenever he falls, when the surrounding text is a particular style, a style of GREP is the answer.

    GREP styles are very powerful, but they also use a lot more in terms of resources that the application of a style of character using other methods. I've seen reoprts ID get bogged down by too many GREP styles.

  • Any attempt to create a GREP Style

    I'm doing a GREP style to one of my paragraph styles, which will take the text from the beginning of a line to a colon and define a character style to it for "BOLD" in this part.

    Example:

    Step 1: Take bread

    Step 2: Take peanut butter

    Step 3: Spread over peanut butter bread

    I don't think I got the syntax right.  I put ^ \:~h and ^: ~ h in the box ' text', thinking it meant "beginning of line until character ':' and at the end", but none of those who gave me the results I want.  Thanks in advance for the help!

    Your trial:

    ^\:~h

    1. you need to escape from the colon. It is one of the few characters who don't not need to escape and make them literal. (It doesn't hurt, you mind, but cleanliness etc..)

    2. you don't need a ~ h - you only need that if you want to scan up to a manually "nested in the Style end here" code.

    3. you need to allow a couple of characters between the beginning of the line and the colon. You can use the wildcard character 'not at all' (and use the shortest match, because otherwise it will engulf all until the last colon):

    ^.+?:

    or be literal and don't allow 'Not' and a single digit:

    ^ \D step:

    Either one will work for you.

  • Point to add to the script or Grep Style?

    Hello

    Is it possible to add a hightlight to a script?  Basically, what I want to do is highlight the text and the tricky part is that the text changes size depending on the size of the file, we are working on that.  I want to highlight automatically the "FOR PROFESSIONAL USE ONLY" the way that we do now is to underscore that in the menu options underscore: say my font size is 8, leading 9.6 (these will always change).

    Weight: = 9.6

    Shift: = - 8*.33

    Color = yellow

    It's the way we do now.  Can it be scripted or Grep style which will automatically do this for certain lines of text only?  And no matter the font size calculate what he needs to do if its 2pt, 10pt 100 PT etc... It will highlight the text specified correctly?

    I hope it's possible...

    Thank you

    The lower one is best.

    I remove a bug and also if not 'what' is provided to the point function culminating and there is no entry in find it which is the find panel of text and text is selected, then this text is highlighted.

    An idea in the script is that a shortcut can be applied to it and it will get its information from the Panel of text search.

    So for now to change the answer to this one

    // Highlight function by Trevor
    // http://creative-scripts.com
    // Custom Scripts for Adobe InDesign, Illustrator and a lot more
    // Beta Version 1
    // https://forums.adobe.com/message/8898663#8898663
    
    function highlight(what, color) {
        var range, s, doc;
        doc = app.properties.activeDocument;
        if (!doc) {
            return 'No Active Document';
        }
        s = app.selection && app.selection[0];
        range = (s && s.properties.underline !== undefined && s.characters.length) ? s : doc;
        app.doScript(f, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, 'Highlight Text');
    
        function f() {
            var finds, find, l, leading, pointSize, currentChangeProps;
            color = color || app.activeDocument.colors.itemByName('Yellow');
            // Store current find change text settings
            currentFindTextWhat = app.findTextPreferences.findWhat;
            currentChangeProps = app.changeTextPreferences.properties;
            what = what || currentFindTextWhat;
            if (what !== '') {
                // if no what is provided then the current entry in the find text panel will be used
                app.findTextPreferences.findWhat = what;
                app.changeTextPreferences.changeTo = '';
                app.changeTextPreferences.underline = true;
                app.changeTextPreferences.underlineColor = color;
                finds = range.findText();
                range.changeText();
                l = finds.length;
                while (l--) {
                    find = finds[l];
                    leading = find.leading;
                    pointSize = find.pointSize;
                    leading = pointSize * find.autoLeading / 100;
                    find.underlineWeight = leading + 'pt'; // This is presuming that font and leading size is set to points!
                    find.underlineOffset = (pointSize - leading) * 1.5; // The 1.5 might need tweaking but seems to work well
                }
                app.findTextPreferences.findWhat = currentFindTextWhat;
                app.changeTextPreferences.properties = currentChangeProps;
            } else if (range !== app.activeDocument) {
                leading = range.leading;
                pointSize = range.pointSize;
                leading = pointSize * range.autoLeading / 100;
                range.underline = true;
                range.underlineColor = color;
                range.underlineWeight = leading + 'pt'; // This is presuming that font and leading size is set to points!
                range.underlineOffset = (pointSize - leading) * 1.5; // The 1.5 might need tweaking but seems to work well
            }
        }
    }
    
    /***************************************************************************************************************************************
    ** If text is selected then the "highlighting" is only applied within the selected text                                              **
    ** Otherwise the "highlighting" is applied within the whole document                                                                **
    ** One could change this to apply to what ever is selected in the Find text document if one wanted to                                **
    ** To highlight the word(s) in the find text panel just use highlight(); or highlight(undefined, app.activeDocument.swatches[5]);    **
    ** One can use highlight('Foo'); to highlight "foo" and ignore what's in the find text panel                                        **
    ** The formating / styles etc. for the find are taken from the find panel                                                            **
    ** If one provides a swatch as the second argument highlight(undefined, app.activeDocument.swatches[5]); that swatch will be used    **
    ** otherwise yellow will be used                                                                                                    **
    ** If one provides a swatch as the second argument highlight(undefined, app.activeDocument.swatches[5]); that swatch will be used    **
    ** If text is selected and what argument is given and the find what in the find panel is empty then the selected text is highlighted **
    **************************************************************************************************************************************/
    
    highlight();
    
  • GREP style - apply character style to the opening and closing parentheses surrounding a 0 (but not 0)

    Hello

    I'm relatively new to GREP style and will have to put in shape about 600 postcards containing various data (via the merger of data), including phone numbers. Consider the following data set:

    1. + 44 (0) 123467800

    2 (©) copyright

    3. (name of the program)

    I want to tell Indesign to stagger the opening and the closing parenthesis of the baseline (with a character style), but only the bracket that include a 0 and, possibly, without affecting the 0 value between them.

    Seems like an easy task, but it is impossible to find a solution. Could someone help?

    Thank you very much

    Antonio

  • Temporarily stop the execution of grep styles

    Hello

    I still bring a book with lots of texts in three languages. I have several paragraph styles with up to 10 grep styles. So my short of very slow InDesign files, I think that cause grep styles in my paragraph style.

    My question is, is there a way to prevent the grep style to run in the paragraph style without removing them?

    Concerning

    Sascha

    Hi Sascha,

    Add an asterisk in front of the GREP expression: *.

    Uwe

  • Grep style short (non-greedy) modifier ignored

    I'm looking for confirmation of a possible bug I've had problems with InDesign version 5.5 upwards through the DC 10.0.0.70.

    What I'm trying to do is apply a character by a rule of grep style in a paragraph style that matches all through the first colon in a block of text. The goal is to make this text bold. My rule of grep is

    .+?:

    which means corresponds to one or more of any character, the shortest correspondence (non-gourmand in the terminology of grep), followed by two points. But the non-greedy modifier is ignored and it does match the text up to the last two points.

    Here is a screenshot.

    Screen Shot 2014-10-02 at 5.05.14 PM.PNG

    I came up with a work around, but it would be nice to make it work properly. I will report it as a bug if others confirm having the same problem. Thank you.

    It works just like it is supposed to - you aren't limited to the first occurrence of the colon, so it matches the first string through the first colon, then matches the following string until the second colon and so on.

    If you want to apply from the beginning of the paragraph to the first two points, you can use ^. + ? :, but it would be much simpler and more effective to use regular nested style through two points 1.

  • About GREP Style (2)

    Hello

    Imagine the following line and how I want to treat:

    "It is on the left side a bwatertiful blEU House with pink you'llow doors and windows. On the right side, we find a beautiful green horse black stIArs and a pue roof rpl! »

    What I mean: some words where the vowels are in bold, somewhere the consonants are in bold, but you can not systematize it.

    In this case, a way to speed up the process to deal with every word? Thanks in advance!

    Piece of cake. He needs 2 character styles (well, one if you want everything is the same: "BOLD") and 2 styles GREP, as well as two invisible characters that you can easily insert without interrupting the flow of regular text. I used "End nested Style" (~ h) and "Non-Joiner Invisible" (~ d) here. the two have no default keyboard shortcut, but those are easily added if you do a lot of them.

    GREP Style 1: [aeiou](?=\w*~h)

    GREP Style 2: [bcdfghj-np-twxyz](?=\w*~j)

    ... I wonder how correct it is to insert 'y' is the consonant or a vowel list. It is not a vowel in "yellow" is? If there is something simple, such as "It's a consonant followed or preceded by a vowel", you can add a style fat isn't (or in my example is not highlighted, by cutting the underscore) for

    (?<>

    (Just thought of this after you have created the image below. He works for switching * off * for vowels, but not for * on * for consonants. Maybe that has need of a 4th GREP).

  • Delicate required... GREP style using a subexpression not staining to find space characters

    I have the section headers in my paper which have a paragraph that are applied to their style. They are always of the form \d\.\d\.\d\.\d(\t) follow in a short sentence of the text. For example:

    5.2.2.1 the rain in Spain falls gently on the crane

    I'm looking for a style GREP can highlight the character of each word with a character style, but not the spaces between words. It seems to imply nested iterations which I do not know how to do, including an expression not staining. Well, it isn't working how I think it should...

    5.2.2.1 the rain in Spain falls gently on the crane



    I think that this style of GREP should get it: (? < = \t) ((\S) +(?:\ s)) + positive looks on the tab between the last digit of the section number and the first word, but the hair subexpressions are not spaces to underscores, instead, I find myself with all the head text highlights as follows:


    5.2.2.1 the rain in Spain falls gently on the crane

    "Nonmarquantes" subexpressions mean nothing to InDesign; You can only use in search operations and replace GREP.

    There may be a single GREP (complicated) style that works, but it might be easier to point out everything and then apply a second GREP style that takes away the underlining of your spaces.

Maybe you are looking for

  • Why my MB Air decreases the wifi signal

    My 2012 13 "core i5 MacBook Air running different operating systems will remove the wifi signal and it is getting worse. someone at - it a reason why?

  • Skype crashing on Mac before logon

    Hello For the last 6 months, Skype crashes before I was even able to connect. My details: Mac OSX 10.7.5. The processor is at 2.8 GHz with 8 GB of memory. I followed all the instructions and Skype several times completely uninstalled and reinstalled,

  • HP ENVY 750-167c Desktop: I just bought this PC can support this new video card?

    We just bought this PC http://support.hp.com/us-en/document/c04812516 We have installed a gtx 750 Ti and its drivers and it worked very well. After a few months, so we decided to move to a 970 gtx so we had a CX500 of Corsair power supply. I installe

  • switch case as C

    Hi all Is it possible to use the loop as a switch case in C. Suppose that one of my numbers to generate processes, like 1, 2, 3 4 all n, so if it generates 2 I want to perform the task mentioned in the event 3, so 2 then he must perform the tasks men

  • Disabeling Windows Mail? Possible?

    Hello! I have a problem with Windows Mail... He lives his own life! :( I try to play WoW and Starcraft and so forth, but I can't, because windows Mail pops up whenever I connect! So I want to disable Windows mail, it out of my computer! I never use t