• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

GREP Dilemma

Participant ,
Jul 06, 2017 Jul 06, 2017

Copy link to clipboard

Copied

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

Views

641

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , Jul 06, 2017 Jul 06, 2017

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|\)

Votes

Translate

Translate
Adobe Employee ,
Jul 06, 2017 Jul 06, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 06, 2017 Jul 06, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jul 06, 2017 Jul 06, 2017

Copy link to clipboard

Copied

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 06, 2017 Jul 06, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jul 06, 2017 Jul 06, 2017

Copy link to clipboard

Copied

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|\)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 07, 2017 Jul 07, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jul 07, 2017 Jul 07, 2017

Copy link to clipboard

Copied

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|\)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 07, 2017 Jul 07, 2017

Copy link to clipboard

Copied

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!

šŸ˜‰

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jul 07, 2017 Jul 07, 2017

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines