Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Grep help for cookbook ingredients

Return to Member Forum

  • Author
    Posts
    • #89923
      Rivkah Lewis
      Member

      Looking for some help again.
      I designed a cookbook. The client wants all of the amounts/measurements in the ingredient list colored and bolded. I have a character style for that, but I’m trying to figure out a quick way to apply without having to go through every line.
      Here’s a sample:

      1 cup milk
      1 cup + 2 Tbsp. flour
      ¼ cup sugar
      1 egg
      2 tsp. baking powder
      1 Tbsp. vegetable or canola oil
      ½ tsp. vanilla sugar
      1?3 cup blueberries or chocolate chips (optional)
      oil, for frying/nonstick cooking spray

      So there are lines with no measurments (oil)
      There are those with a number and amount – “1 cup” milk (the number and word cup should be bold and color)
      There are those with two: “1 cup + 2 Tbsp.” flour
      There are fractions: “½ tsp.”, “1?3 cup”

      Any brilliant shortcuts?

      Thanks!

    • #89926

      Try this one:

      [\xBD\xBC\d](\?\d)?\x20\w+\.?
      
    • #89936
      Rivkah Lewis
      Member

      Thanks!
      Almost perfect.

      When I have something like
      2¼ cups
      it skips the first number and gives me the fraction and the cups.

    • #89940

      > Do I understand correctly that I have to select each text frame and apply the script?

      Did you remove your last post? > I assume, that you work with para styles and apply the character style with a GREP-style!

      > When I have something like2¼ cups it skips the first number and gives me the fraction and the cups.

      You get, what you want ;-)

      [\xBD\xBC\d]+(\?\d)?\x20\w+\.?
      

      Kai

    • #89943
      Rivkah Lewis
      Member

      > Do I understand correctly that I have to select each text frame and apply the script?
      This was from my other post about the script!

      I don’t understand the last thing you wrote:
      You get, what you want ;-)
      [\xBD\xBC\d]+(\?\d)?\x20\w+\.?

      That takes the fraction and the text following, but not the number before the fraction.

    • #89944

      Did you see the minor change in the last GREP? [\xBD\xBC\d]+ will find a fraction, a number AND a number with a followed fraction!

    • #89974
      Rivkah Lewis
      Member

      I must hvae not pasted it before so it was using the old one.
      It works now.
      Thanks ever so much!

Viewing 6 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads