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

Return to Member Forum

  • Author
    Posts
    • #33853
      jerugal
      Member

      I need to change the character style of any amount of words..as long as it ends with “:” a collin

      I tried doing
      ([\u]+:)
      but that only gives me 1 word attached to the collin

      then I tried:
      ([\u]+ [\u]+:)

      but again that only gives me 2 words nearest to the collin

      any ideas on how to get ” any word in the paragraph before a collin” ?

      THANKS!!!

    • #33855
      David Blatner
      Keymaster

      If you are trying to apply the character style from the beginning of the paragraph up to (or including) the colon, I would suggest using a nested style rather than a grep style. (Nested styles are much easier anyway.)

Viewing 1 reply thread
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads
  • You must be logged in to reply to this topic.Login

GREP help

Return to Member Forum

  • Author
    Posts
    • #57263
      skemp
      Member

      Hi all,

      Can any one help with a GREP expression to find an entire paragraph which has been keyed in all uppercase characters?

      I have been trying with negative lookbehinds/lookaheads for lowercase letters but don't quite get it right.

      I can get the lookahead bit right…

      u(?!.*l)

      this is all lowercase

      THIS IS ALL CAPS

      but…

      a THIS IS ALL CAPS only applies the formatting (underline) to the text following the lowercase letter.

      A similar negative lookbehind for any lowercase letter

      (?<!.*l.*)u(?!.*l)

      removes all the formatting!

      Any ideas anyone.

      Thanks

      Simon.

    • #57267
      Anonymous
      Inactive

      How about something like this

      (u+L)[^ ]L+(?=r)

      That will find

      THIS IS AN ENTIRE PARAGRAPH KEYED IN UPPERCASE.

      But it won't find

      THIS IS not An ENTIRE paragraph KEYED in UPPERcase.

    • #57268
      skemp
      Member

      Thanks Eugene,

      How do you get the backslash characters to show in these posts?

    • #57269
      Anonymous
      Inactive

      You need to do them x2

      When I type the backslash here I am actually typing it twice but it's only showing up once “”

      Here's another GREP to find the same thing

      ([A-Z]+)[^ ]+[^a-z]+(?=r)

    • #57270
      skemp
      Member

      Hi Eugene,

      Your two greps are almost there, unfortunately lowercase letters at the beginning of the paragraph are ignored. I got this far too.

      However:

      ^[^l]+$

      Does work.

      Credit for this should go to Peter Kharel, his example on the Adobe InDesign Forum showed how to find paragraph without parenthesis ( or ). I simply adapted it for lowercase letters (l).

      Simon.

    • #57271
      Anonymous
      Inactive

      I'd need some samples of the text to work out exactly what you need.

      From what I understood you wanted to select an entire paragraph of uppercase letters.

      Glad you found a solution though :)

      GREP can be tricky

    • #57272
      skemp
      Member

      Yes, I wanted to find a paragraph of uppercase letters.

      I will eventually be using this in a Find Change but set up a Grep Style for testing purposes as you can instantly see what's happening.

      This is why I said “lowercase letters at the beginning of the paragraph are ignored”, they weren't having the character style (red text) applied.

      Thanks.

      Simon.

    • #57273
      Anonymous
      Inactive

      I'm not really following that at all?

      I'd need to specific examples of the text and what you expect to find or not find.

    • #57274
      skemp
      Member

      Sorry Eugene, I am making this seem more complicated than it is.

      I am using a Grep Find/Change operation to locate paragraphs typed entirely in all uppercase letters and apply a paragraph style.

      To test the grep expression to make sure it was going to find exactly , I used a Grep Style, applying a “red” character style to highlight the found text.

      This allows me to instantly see if the Find/Change operation is going to apply the paragraph style to the wrong text.

      My own solutions (I like to try for myself first) were almost there but not quite. In the end I gave up and posted to this forum and also searched the Adobe Forums for a solution and found Peter Kharel's.

      ^[^l]+$

      This works perfectly.

      Thanks,

      Simon.

    • #57277

      (Aside – you're never too old to learn –:)

      A few of the common set commands also have a negatory command built-in:

      D is not d — anything except a digit

      U is not u

      L is not l

      W is not w

      S is not s

      B is not b (not usable on its own)

      The big caveat with all of these is that they also ignore the Hard Return! (*) But when you explicitly test with '^' and '$', Peter's GREP can be written, slightly shorter, as

      ^L+$

      (*) Which can be really annoying, because all other wildcards stop at the next Hard Return, unless specifically instructed otherwise.

    • #57278
      Anonymous
      Inactive

      Very good Jongware – I was thinking far too literally.

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