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 wildcard question

Tagged: 

Return to Member Forum

  • Author
    Posts
    • #88225
      Anonymous
      Inactive

      Hi All,

      for my first post here, here’s a question about GREP.

      I would like to know if there is such a thing as a “found character” wildcard. Explanation:
      – I have a bunch of characters in a long text that have been vertically offset -.75pt
      – I want to turn that around and reset the offset to 0pt
      – they are all different characters
      – I can leave the search/replace fields banks and just enter the formats to search and replace, but when I do so, the characters found are replaced with NULL, i.e. they are deleted
      – I wish I could instruct InDesign to “replace with found character”

      Is this possible? How to do it?

    • #88227
      Peter Kahrel
      Participant

      You may not have properly emptied the Find what and Change to fields.
      You don’t need Grep, you can do this in both the Text and the Grep panels:

      1. Make sure that the Find what and Change to fields are empty.
      2. In the Find format panel, enter -0.75 points
      3. In the Change format panel, enter 0 points. This will be displayed as ‘+not shifted’ in the panel.
      4. Do the replacement.

      Works for me.

      Peter

    • #88228
      Anonymous
      Inactive

      Hi Peter,

      thanks (for your great scripts too, and that includes the one for kerning pairs!).

      Okay you’re right, I must’ve left a space in there.
      My question about the wildcard still stands, though, because I merely used this problem to finally ask something I’ve been wondering about for a long time, and something I’ve often needed and never took the time to properly investigate.

      So, does the “found character” wildcard exist? Or how is it possible to achieve something similar with GREP? Is it only?

    • #88229
      Peter Kahrel
      Participant

      Yes, it does:

      Find what: (.)
      Change to: $1

      This would replace any character (except the paragraph return) with itself. The parentheses create a referent, which is referenced by $1. You can do 10 references:

      Find what: (.)(.)
      Change to: $1$2

      etc.

    • #88232
      Anonymous
      Inactive

      Simple – Clever – Incredibly useful

      Thank you

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