0 Replies Latest reply on Sep 17, 2013 9:37 AM by Karl Z

    Grep Styles - Conflicting - "^" not working in lookbehind and more

    Karl Z Level 1

      Hi,

       

      Still fighting my way in the jungle of paragraph grep styles.

      In InDesign CS5 by the way.

       

      I import text from DB and they all come in the same.

      I need to use the same paragraph style to all paragraphs.

      I really don't want to use find-change since that would mess up the xml holding the data.

       

      Example-text explanation:

      • All sizes are separated by ", - "

      • …… = tab

      • Not all rows have tab

      • Sizes can be both numeric, letters, contain "/" and "-" and """ and " " (space) and yes indeed a "," comma!! (and every other idiotic combination you culd think of.)

      • When only 2 posts in a row - should be separated by a ", " = (Comma-space)

      • When more than 2 posts i a row - all posts but first and last should be hidden and separated by " - " (space-dash-space)

       

      I have tried numerous combinations to get them all but they always conflict with each other.

      Bugger!

      I really shouldn't be impossible.

       

      Is it possible in Paragraph grep styles to "catch" "any character but these" and kind of make a character-set like [!not this character]   (= [!a|b|c]  )

      Is it possible to count the number of posts in a row? ( like... if more than 2 then hide...bla bla)

       

      All sizes are separated by the same ", - " and sometimes I want to hide them, and somtimes I want to use one of them...

      Is there any kind of "if-else" thing that can be used??

       

      My original idea was to be able to catch them by using ^-combinations for beginning of paragraph and matching with tha linebreak and tab but it seems as if that don't always work when using positive or negative look-behind-ahead.

       

       

      Oh, I'm blabbering. Sorry.

       

       

       

       

      Any hints or pointers would be greatly appreciated.

       

      /K

       

       

      A) Got this - Original textSame text but this is my Goal!

      134/140, - 146/152, - 158/164……….299,-

      134/140, - 146/152……….299,-

       

      38, - 40, - 42, - 44, - 46……….399,-

      38, - 40……….399,-

       

      XS, - S, - M, - L, - XL……….399,-

      XS, - S, - M, - L

      XS, - M

      XS, - S, - M, - L, - XL……….399,-

       

      B 70, - 75, - 80, - 90, - 95……….199,-

      B 70, - 75……….199,-

       

      Medium-Wide 17”, - 17,5”……….995,-

      Normal, - X-Wide……….999,-

       

      16 mm 95, - 105, - 115, - 125, - 135, - 145…......99,-

      16 mm 95, - 105……....99,-

       

      134/140 - 158/164……….299,-

      134/140, 146/152……….299,-

       

      38 - 46……….399,-

      38, 40……….399,-

       

      XS - XL……….399,-

      XS - L

      XS, M

      XS - XL……….399,-

       

      B 70 - 95……….199,-

      B 70, 75……….199,-

       

      Medium-Wide 17”, 17,5”……….995,-

      Normal, X-Wide……….999,-


       

       

      16 mm 95 - 145…......99,-

      16 mm 95, 105……....99,-



       

       

       

      GrepStyleResult wanted

      ,\s(?<=,\s)-\s.+(?=\s-)

       

      Red undelined text will be hidden

      (Got this)

      134/140, - 146/152, - 158/164……….299,-

      134/140, - 146/152……….299,-

       

      38, - 40, - 42, - 44, - 46……….399,-

      38, - 40……….399,-

       

      XS, - S, - M, - L, - XL……….399,-

      XS, - S, - M, - L

      XS, - M

      XS, - S, - M, - L, - XL……….399,-

       

      B 70, - 75, - 80, - 90, - 95……….199,-

      B 70, - 75……….199,-

       

      Medium-Wide 17”, - 17,5”……….995,-

      Normal, - X-Wide……….999,-

       

      16 mm 95, - 105, - 115, - 125, - 135, - 145…......99,-

      16 mm 95, - 105……....99,-

      Need this to not conflict with other grep

       

      blue underlined text needs to be hidden.

      134/140, - 146/152, - 158/164……….299,-

      134/140, - 146/152……….299,-

       

      38, - 40, - 42, - 44, - 46……….399,-

      38, - 40……….399,-

       

      XS, - S, - M, - L, - XL……….399,-

      XS, - S, - M, - L

      XS, - M

      XS, - S, - M, - L, - XL……….399,-

       

      B 70, - 75, - 80, - 90, - 95……….199,-

      B 70, - 75……….199,-

       

      Medium-Wide 17”, - 17,5”……….995,-

      Normal, - X-Wide……….999,-

       

      16 mm 95, - 105, - 115, - 125, - 135, - 145…......99,-

      16 mm 95, - 105……....99,-