1 Reply Latest reply on Nov 27, 2009 12:37 AM by Peter Kahrel

    Find and Replace digits




      I am working in Indesign CS3.


      I am trying for a different find and replace option but I am not getting what I want. Here is the scenario:


      I have many documents in which the phone numbers are given as (000)-000-0000. I want all the numbers to replace with +1 prefixed and without brackets and dashes, like this, +1 000 000 0000.

      Now, I am able to find the numbers using ^# (any digit) in "Find What" by entering(^9^9^9)-^9^9^9-^9^9^9^9But couldn't replace with the format I am looking for which is +1 ^9^9^9 ^9^9^9 ^9^9^9^9 (+1 prefixed and no dashes). It is not working.


      I can still use Find What using the any digit option, but manually need to retype the numbers, hence, it will be really great if someone can give me the easiest way or script to use Replace all phone numbers format without changing the numbers.


      There are many documents with minimum 100 pages and with phone numbers entered in different locations which I need to replace with the format I required. Again, I am using Vista and Indesign CS3.


      Many thanks in advance!


        • 1. Re: Find and Replace digits
          Peter Kahrel Adobe Community Professional & MVP

          Use find/changeGrep, not find/ChangeText:


          Find what: \((\d\d\d)\)-(\d\d\d)-(\d\d\d\d)

          Change to: +1 $1 $2 $3




          \(           Match left parenthesis

          (\d\d\d)   Match three digits, parentheses create referent

          \)           Match right parenthesis

          -             Match hyphen

          (\d\d\d)  Match three digits, create referent

          -             Match another hyphen

          (\d\d\d\d)     Match four digits, create referent


          Change to+ +1 space, reference to the first referent, space, reference to the second referent, etc.