9 Replies Latest reply on Jul 7, 2017 10:55 AM by winterm

    GREP Dilemma

    r5dsign Level 1

      I am using GREP to skip some words from being italicized (I show them in red for visual reference) However, GREP is not catching "var." as shown on the third line in  screenshot below. Any advice would be greatly appreciated. And if there is a cleaner way to write my GREP expressions, advice is also appreciated. Thank you in advance.

      Screen Shot 2017-07-06 at 10.52.22 AM.png

        • 1. Re: GREP Dilemma
          amaarora Adobe Employee

          Hi,

          After having written all my text in italicized manner,I would rather use simple find change for the list of words I want non italicized.

          It simply depends on the diversity and number of words that you wish to be non-italicized.

          Here, since the words do not have any in common pattern..(like ending with a dot).. i used find change (If they do -> then grep makes more sense)

           

          Here is a small example...

          1. I wrote all my text using a paragraph style (p1) having minion pro in italic style.

          2. I then created a character style (c1) with minion pro in bold style.

          3. In the end, I used simple find/change to get the desired text style

          This is one of the most simple way to achieve what you want! You can still wait since I am sure people here will have better and more efficient solutions.

           

          -Aman

          1 person found this helpful
          • 2. Re: GREP Dilemma
            r5dsign Level 1

            I agree with amaarora's answer but unfortunately, there is more than those words that I need to skip (not italicize). So, GREP expressions was the solution but I just can't understand why some words are not being detected. Still hoping for someone to assist.

            • 3. Re: GREP Dilemma
              winterm Level 5

              In the first style you missed | at the very end:

              \bvar.|\)

              in the third style no need for backslash:

              & var. will work just fine.

              In fact, no need for that third style at all - you can rewrite the end of the line in the first style as:

              \h?|&?\s?var.|\)

              That's minimal corrections to answer your question shortly.

               

              If you expect further modifications/cleaning you should provide us with editable copies of existing queries (it’s a pain to rewrite it from screenshot)

              • 4. Re: GREP Dilemma
                r5dsign Level 1

                Winterm's response is getting me very close to what I am trying to accomplish. The only issue now, is that it is italicizing (making red) words that have "vari" in it as shown in second entry (A. variabilis) in screenshot below.

                Thank you for the tip on editable expressions. Here they are:

                Expression 1

                \*\h?|\(Now\h|ssp.\h?|\bvar.\b\h?|and?\s?var.|\)

                 

                Expression 2

                \*\h?|var.|\(Formerly|\(PO|\(SE|\h|\)

                 

                Screen Shot 2017-07-06 at 4.28.51 PM.png

                • 5. Re: GREP Dilemma
                  winterm Level 5

                  Try this. Rather unwieldy, but all-in-one:

                  \*\h?|\(Now\h|\(Formerly\h|\(p\.\h\d+|\(PO\b|\(SE\b|\band\h|\bssp\.\h?|&?\h?var\.\h|\)

                  • 6. Re: GREP Dilemma
                    r5dsign Level 1

                    Were getting close to a correct answer thanks to winterm. The only issue now is that the expression is skipping the word "var." as circled in red on screenshot below. Any suggestions to correct this issue would be most appreciated.

                    Screen Shot 2017-07-07 at 10.15.08 AM.png

                    • 7. Re: GREP Dilemma
                      winterm Level 5

                      As I can see, you're using a different query, not that I posted.

                      I see \var. - that's pretty meaningless and couldn't work, no surprise.

                      Again, try exactly this one query:

                      \*\h?|\(Now\h|\(Formerly\h|\(p\.\h\d+|\(PO\b|\(SE\b|\band\h|\bssp\.\h?|&?\h?var\.\h|\)

                      • 8. Re: GREP Dilemma
                        r5dsign Level 1

                        I think I just answered my previous question. Since the document I received has a lot inconsistencies, all I had to do is use winterm's solution but added a question mark in front of h (to denote that a space may or may not exist after "var." as made bold and underlined in expression below.

                         

                        \*\h?|\(Now\h|\(Formerly\h|\(p\.\h\d+|\(PO\b|\(SE\b|\band\h|\bssp\.\h?|&?\h?var\.\h?|\)

                         

                        Thank you all for pitching in!

                        ;-)

                        • 9. Re: GREP Dilemma
                          winterm Level 5

                          Oh, I thought it can't be at the very end of a para... If it can, without a space after it - than yes, put that ?

                          I can't get why you need to catch those spaces after, anyway