GREP not prices

Home Forums InDesign User Groups GREP not prices

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Masood Ahmad 3 weeks, 6 days ago.

  • Author
    Posts
  • #70197

    nellbern
    Member

    Would like to find all prices instances on a document & replace them with a tab

    The following grep expression works:
    note: i’m using \\ escape characters because i’m using applescript

    (\\$?)\\d+\\.\\d{2} which find any prices including or not the $ symbol Example: $1.99 $12.99 $445.99 15.99 4.99
    this one works too [[=$=]]?[[:digit:]]?[[:digit:]][[=.=]][[:digit:]][[:digit:]]

    but it’s also find digits that fall on the same category but they are not prices. Like: 1.99 oz or 22.45 lts or 5.44 ozs & it’s replace them with a tab leaving the word oz, lts & ozs. I tried lookahead (\\$?)\\d+\\.\\d{2}(?! OZ|oz|lts|ozs) but still it doesn’t work. What am i’m doing wrong?

  • #70257

    Masood Ahmad
    Member

    Would it be possible for you to provide some more text with a desired output (manually). I’m unable to figure out what applescript has to do with your prices. In your example, I can’t see any backslashes.

You must be logged in to reply to this topic.