1 Reply Latest reply on Oct 11, 2011 8:56 AM by Eugene Tyson

    GREP question

    allisonblake Level 1

      Mac OS 10.6

      ID CS 3 (5.0.4)

       

      I have a grep search that searches for text in a list and adds the word "and" before the last instance. E.G.,  One, two, three are numbers becomes One, two, and three  are numbers

      I'm using " are" as the delimiter/positive lookahead to identify the last item in the list.

       

      Find what:

      [\l\u]+(?= are)

       

      Change to:

      and $0

       

      The above find/replace works, except that "and" gets capitalized: One, two, And three  are numbers.

      If I change the Change to field to " and $0" (adding a space before the word "and"), then "and" is NOT capitalized.

       

      I'm doing this as part of a script so I simply have the script run a second search to remove the extra space.

       

      But is this seemed weird to me. Is there something wrong with my grep?

       

      Thanks!