Skip to main content
August 29, 2011
Question

GREP-Search and JavaScript

  • August 29, 2011
  • 1 reply
  • 1627 views

Hello,

I'm using ID CS4 and wrote a script using GREPs, now I have two questions:

1. is there some way to mark all changes made by the script. I tried to use the note-function, but the whole script creates one note. However, the user should be able to see what was changed by the script. How do I do this?

2. Let's say I'm searching for "([\l\u])/([\l\u])". Is there a way to change the characterstyle of the first part ($1) but leave the second ($2) untouched? Can I at least use the search-function to get the position of the first character of the searched expression?

Thank you for your help.

Best Regards.

This topic has been closed for replies.

1 reply

Marcos_Suárez
Known Participant
August 30, 2011

You search (GREP):

([\l\u])(?=/[\l\u])

and changes in

$0

(and applying the character style)

August 30, 2011

Thank you for your answer, unfortunately this is not what I was looking for.

I want the second part of the search-result to be untouched. Using $0 will change the whole result. :/

Kind Regards

Jongware
Community Expert
Community Expert
August 30, 2011

still_und_leise wrote:

I want the second part of the search-result to be untouched. Using $0 will change the whole result. :/

How do you know -- did you even try it?

Because it does not, that's what the lookahead was supposed to do.