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

20102Re: [NTB] Regular Expression Problem

Expand Messages
  • Tony Mc
    Sep 30, 2007
      On Sat, 29 Sep 2007 22:50:39 +0100, you wrote:

      > HI Tony,
      > > Search for: ^(.*@.*)\t(.*?)(\(.*?\))\t(.*)$
      > > Replace with: $2 <$1>\t$3\t$4
      >
      > This suggestion seems not to tackle the main part of the problem -
      > getting the first field to wrap the newly inserted name in quotes and
      > the address in <>.
      >

      Hi Greg,

      sorry, I missed the bit about the name being enclosed in quotes,
      though the replacement above will enclose the email address in angle
      brackets (why do you think it doesn't?). So, to do the wrapping of the
      name, try this:

      Search for: ^(.*@.*)\t(.*?)\s+(\(.*?\))\t(.*)$
      Replace with: "$2" <$1>\t$3\t$4

      The search string is the same as before except that there is a \s+
      between the name and comment fields, which prevents white space from
      being included in the name field. Anyway, let me know if this does
      what you want.

      Best,
      Tony
    • Show all 20 messages in this topic