4 Replies Latest reply on Nov 20, 2013 7:07 AM by BJS13

    InDesign GREP - Serial Commas

    BJS13

      Hi, I am trying to automatically add in missing serial commas. In these examples:

       

      red, orange and yellow.

      red bike, blue bike and yellow bike.

      red, green and gold polka dots and blue.

       

      Using this script:

       

      FIND (?<=\w,)(.*?)(?= and)

      CHANGE $1,

       

      I can get the top two sentences to work correctly, but I cant get the last one to work properly. It always selects the first instance of "and", and adds the commas there. I need it to select the LAST instance of "and" in a sentence. Can anyone help?

       

      Thanks