14 Replies Latest reply on Nov 11, 2013 10:51 AM by Peter Spier

    Using GREP to bold Date and Event Name

    ZenDao Level 1

      Hi

       

      I am stumped at how to properly apply a bold style to a combination of dates and event names using GREP. I am including three examples below. I do have Paragraph and Characters styles set up. The area I would like to effect the change is in all caps. I am trying to add a bold style only to the dates and the title of the event with out changing the rest of the information.

       

       

      I started of with this GREP Style:

       

       

      \d{1,2}\/\d{1,2}|\d\-?\s|\u

       

       

      It is bolding the dates and the name of the event. But it's not bolding the small dash between events that have a beginning and end dates or the en dash. It is randomly bolding other numbers and capital letters that it should not. Very frustrating. Each time I alter the GREP Style above, it makes it worse. This is as close as I got to the desired effect. Any ideas how to fix this?

       

       

      12/6-8 — HEALING WEEKEND AT TRUE NORTH HOLISTIC CENTER.  Friday  11am-5pm. Private Integrated Healing sessions, Friday 6:30pm-Sunday noon. “Blue Christmas” Retreat: Coping with Sadness at the Holidays; Sunday 3-7pm. Public Integrated Reiki™ clinic. Hubbardston, MA  www.truenorthholisticcenter.org. (978) 820-1139.

       

       

      12/6-12/8 — READ AND PLAY MUSIC IN A WEEKEND! World famous seminars turns beginners into musicians, revitalizes and inspires even pro musicians. 169 Mass Ave, Boston. (781) 599-1476 or http://signup.understandingofmusic.com or sallee@dlorien.com.

       

       

      12/7 — REIKI CERTIFICATION. Wilton, NH. Libby Barnett, MSW. 32 years experience. Reiki Energy Medicine author. Notebook, pin, certificate awarded. Credit cards accepted. CEU’s/contact hours. Call (603) 654-2787 or www.reikienergy.com. Reiki II: 12/8

        • 1. Re: Using GREP to bold Date and Event Name
          Salah Fadlabi Level 5

          Why not you are used a paragraph style include with character nested style (through or up to) to the end of event name.

          • 2. Re: Using GREP to bold Date and Event Name
            Peter Spier Most Valuable Participant (Moderator)

            try ^.+?[.!] for the GREP style. It will find everything at the beginning of a paragraph up to the first period or exclamation point. If you need to limiti it to paragraphs that start with a date (becasue you aren't using a separate style for these), you can use ^\d{1,2}\/\d{1,2}.+?[.!] and if any of the listings use a different punctuation mark to end, add it to the class at the end.

            • 3. Re: Using GREP to bold Date and Event Name
              Peter Spier Most Valuable Participant (Moderator)

              Salah Fadlabi wrote:

               

              Why not you are used a paragraph style include with character nested style (through or up to) to the end of event name.

              I thought the same thing until I noticed the ! ending one of the events....

              • 4. Re: Using GREP to bold Date and Event Name
                SJRiegel Adobe Community Professional & MVP

                A nested style could still work. It would require adding a "end nested style here" marker at the end of each event name.

                • 5. Re: Using GREP to bold Date and Event Name
                  Peter Spier Most Valuable Participant (Moderator)

                  Yeah, but that's just as much work as doing it manually if the text is already set, so the GREP style is a better solution.

                  • 6. Re: Using GREP to bold Date and Event Name
                    ZenDao Level 1

                    Thanks! That works. I am using a paragraph style for the body and have a bold character style for the information that needs to be bolded. I notice there are some listings that uses a colon and the bolding continued into the description where the first period appears (see samples below). I added a colon (to the shorter GREP style you suggested) in addition to the perod and excalamation point to search for.. Now the bolding stops at the colon but does not include up to the word "CARRY" (see first example). The second example, the bolding should stop after "FAIRE" but cotinues to the word Wisdom because of the period.

                     

                    I wish there was a option in the GREP drop menu to search for All Caps only and not Any Uppercase Letter. Is it a case were I need to manually edit those instances so it conforms to the norm? Or is there away to modify the GREP expression ^.+?[.!] to also include other instance like the example below?

                     

                    I alread try to add an additional rule using the Postive Look Ahead and nothing. And using the Any Uppercase Letter option, either forces the text back to the begining looking unstylized or it forces any capital letters to be bolded.

                     

                     

                    12/8-12/13 — WESTERN REIKI MASTERS: BE ATTUNED TO CARRY Japan’s Gendai Reiki lineage: Usui Mikao-Kan’Ichi Taketomi-Kimiko Koyama-Hiroshi Doi-Audrey Pearson. Learn to teach all 4 levels of Japan’s Gendai Reiki Ho. www.yogapathways.com. (508) 740-9870 or Facebook: ‘Gendai Reiki America’

                     

                    11/23 — PSYCHIC AND HOLISTIC FAIRE at Women of Wisdom. North Easton, MA. Psychics, angel readings, mediums, crystal healings, Gaiadon Heart, chair massage, Reiki and more! Sign yourself up for a few appointments and bring your friends! www.womenofwisdominc.com (508) 230-3680.

                    • 7. Re: Using GREP to bold Date and Event Name
                      Peter Spier Most Valuable Participant (Moderator)

                      If you have headings that don't conform to a pattern that can be recognized, as it appears that one does not, then you have to deal with them manually. I'm on my way out again, but I'll try to look some more later, or tomorrow, and see if something else occurs to me. I expect you'll need a second style to apply from the first colon to the second, if that's your aim. In your examples above I don't wnow which part you want styled.

                      • 8. Re: Using GREP to bold Date and Event Name
                        pixxxel schubser Level 5

                        Peter Spier schrieb:

                         

                        Yeah, but that's just as much work as doing it manually if the text is already set, so the GREP style is a better solution.

                         

                        For me the following nested Style works:

                         

                        EinSatz.png

                         

                         

                        @ZenDao,

                        should the result look like this?

                        • 9. Re: Using GREP to bold Date and Event Name
                          Peter Spier Most Valuable Participant (Moderator)

                          I'm not sure what your trigger value is (google translates sätze as rates). Entering a string of characters in a nested style is not reliable as it will match the first inidvidual cahracter from the string that is encountered.

                          • 10. Re: Using GREP to bold Date and Event Name
                            ZenDao Level 1

                            Yes, the sample image does look like that. Although, I am using sanserif type for the text. The problem I am running into with both GREP and Nested styles is that if there is no punctuation for the styles to home in on in the part that only needs to be bolded, the bolding runs in to the description where the punctuations does exist.

                             

                            I have feeling for those instances where I cannot rely on punctuations as a styles references, I would either need to created an addedum to the parent paragraph style or add a marker of some kind whether I use GREP or Nested.

                             

                            I am excited about using GREP since it represents new territory for me and if I can avoid manually adding some kind of invisible markers, which I have been doing using Nested styes, that would be great.

                            • 11. Re: Using GREP to bold Date and Event Name
                              pixxxel schubser Level 5

                              @ZenDao,

                              I take your own examples. GREP or nested styles there is only one requirement: a fixed rule. Since there is no „maybe“ or no "what if". Otherwise you have always additional wrong negativ or wrong positive results.

                               

                              @Peter Spier,

                              hello. Sorry, but my englisch isn't the best. I think my trigger value „Sätze“ are „sentences“. This works in this case correctly. With the examples of the @ZenDao is no need to entering a seperate string of characters in this nested style.

                               

                              Regards

                              pixxxelschubser



                              • 12. Re: Using GREP to bold Date and Event Name
                                Peter Spier Most Valuable Participant (Moderator)

                                OK, through 1 sentence would work, as long as the styling isn't supposed to stop at a colon or other mark that isn't considered a sentence ending.

                                • 13. Re: Using GREP to bold Date and Event Name
                                  ZenDao Level 1

                                  Hi Peter,

                                   

                                  I am still tinkering with the ^.+?[.!] expression. I was thinking, is there a GREP expression to tell it to apply the character style to only variable length phrases (at the beginning of the each listing) that are all caps with or without relying on looking for the punctuation in this case?

                                   

                                  Another thought would be to reword the opening phrase and add a line break, to have an event name and description separate. But I have not figure out how to use a carriage return with the ^.+?[.!] expression. It does not seem to recognize \r or ^m for a carriage return.

                                  • 14. Re: Using GREP to bold Date and Event Name
                                    Peter Spier Most Valuable Participant (Moderator)

                                    I think you'll have a lot of trouble trying to use the all caps, given that you have a variable length and a lot of spaces, but I won't rule it out.

                                     

                                    If you use a forced line break you can use an ordinary nested style up to a line break -- no need for GREP (did you try pixxxel schubser's suggestion, by the way?). And a paragraph break means using a new paragraph style for the first part -- again, no GREP.