6 Replies Latest reply on Jul 30, 2009 5:39 AM by [Jongware]

    find/replace grep

    René Mølsted

      Hi all,

      I need to insert a forced linebreak after the first comma in each paragraph. If the paragraph only contains one comma, no problem but if theres more than that it either inserts af all or the last (due to the nature of grep).

      Is there a way of limiting grep to the first match?

       

      I've tried the following:

      app.findGrepPreferences.findWhat = '(.+?, )';

      app.changeGrepPreferences.changeTo = "$1\n";

       

      and

      app.findGrepPreferences.findWhat = '(.+?, )(.+?[,*])';

      app.changeGrepPreferences.changeTo = "$1\n$2";

       

       

      Hope some one can nail this ;o)

       

      --

      molsted