Skip to main content
Participating Frequently
September 14, 2009
Question

help with little script using grep

  • September 14, 2009
  • 1 reply
  • 1786 views

i am a begginer but i guess this will not be a problem for somebody who is experienced...

i am working with a lot of files that have tags. tag for italic text, tag for centered text and so on, i manage to

get regular expression to work and to do all of these things with find/change dialog, but i would like to

automate all of it..

so for example i have part of the text that need to be italic that is enclosed in underscores like this _something that needs to be italic_

and i have this regular expression that takes care of it _[A-Za-z0-9,;\-\?\(&!\):'". ]+_

finds all the matches and applies the text style i want.

how to do that with script? thanks in advance.

This topic has been closed for replies.

1 reply

Participating Frequently
September 14, 2009

any hints?

Marc Autret
Legend
September 15, 2009

Use FindChangeByList.jsx (with 'grep' findType).

@+

Marc

Participating Frequently
September 15, 2009

ok, ok tried that, i opened FindChangeList.txt and changed one line and uncommented it

here is who it looks:

grep  {findWhat:"_[A-Za-z0-9,;\-\?\(&!\):'. ]+_"}  {applied paragraph style:paragraph style "boldanditalic"} {includeFootnotes:true}  finad and change to ita

and it doesnt work

i tried some of the text examples and they do work...what is going on? is there any simple test to try?

(this regex works in find/change dialog)

thanks again for the effort