Loading ...
Sorry, an error occurred while loading the content.

[Clip] Re: clip for inserting dots into number string

Expand Messages
  • diodeom
    ... In this case the notation could be even further stripped of redundancy: ^!Replace ^ d{3} K d{3} .$0 . WARS Perhaps test first how it works via the
    Message 1 of 11 , Aug 13, 2010
    • 0 Attachment
      Mike Breiding - Morgantown WV <mike@...> wrote:
      >
      > diodeom wrote:
      >
      > > Are your phone numbers strings of continuous ten digits?
      >
      > Yes, in a column such as:
      > 3042910020
      > 3042910020
      > 3042910020
      >
      >
      > Thanks,
      > -Mike
      >

      In this case the notation could be even further stripped of redundancy:

      ^!Replace "^\d{3}\K\d{3}" >> "\.$0\." WARS

      Perhaps test first how it works via the "manual" replace dialog (Ctrl+R) with Regular Exp. checked. The search pattern ^\d{3}\K\d{3} should highlight fourth, fifth and sixth digits. The replacement \.$0\. should place dots around that selection.
    • flo.gehrke
      ... Hi Dio, I love those RegEx which do not capture anything. So if we ve got a pure one-column list like that we could also write just... ^!Replace
      Message 2 of 11 , Aug 14, 2010
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "diodeom" <diomir@...> wrote:
        >
        > > 3042910020
        > > 3042910020
        > > 3042910020
        >
        > In this case the notation could be even further stripped of
        > redundancy:
        >
        > ^!Replace "^\d{3}\K\d{3}" >> "\.$0\." WARS

        Hi Dio,

        I love those RegEx which do not capture anything. So if we've got a pure one-column list like that we could also write just...

        ^!Replace "\d{3}\K(?=\d{3})" >> "." AWRS

        BTW, you could strip even more: There's no need to escape the dot in the replacement string here ;-)

        Regards,
        Flo
      Your message has been successfully submitted and would be delivered to recipients shortly.