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

Re: [NTB] $1 in regular expression replace function not recognized

Expand Messages
  • David Smart
    Or put an extra backslash in to force the 2 to a literal, and thus separate it from the $1 ... $1 2000$2 BTW you have too many zeroes in your replacement
    Message 1 of 4 , Oct 3, 2008
    • 0 Attachment
      Or put an extra backslash in to force the 2 to a literal, and thus separate
      it from the $1 ...

      $1\2000$2

      BTW you have too many zeroes in your replacement expression - it currently
      makes 20008 instead of 2008.

      Regards, Dave S

      ----- Original Message -----
      From: "Alex Plantema" <alex.plantema@...>
      To: <notetab@yahoogroups.com>
      Sent: Saturday, October 04, 2008 7:07 AM
      Subject: Re: [NTB] $1 in regular expression replace function not recognized


      > Op vrijdag 3 oktober 2008 20:23 schreef mycroft_b:
      >
      >> I want to replace dates formatted as mm/dd/yy as mm/dd/yyyy. Example
      >> 07/29/08 changes to 07/29/2008.
      >>
      >> I set up my search and replace as Reg Expr (\d\d/\d\d/)0(\d\s) and
      >> replace with $12000$2.
      >> I checked the box for Regular Expression.
      > ...
      >> It FINDS ok, but replaces this example with $12008. For some reason,
      >> the first group ($1) is not recognized in the replace although the
      >> second group ($2) is.
      >
      > It looks like NoteTab is confused because $1 is followed by a digit.
      > But replacing (\d\d/\d\d)/0(\d\s) by $1/200$2 does work.
      >
      > Alex.
      >
      >
      > ------------------------------------
      >
      > Fookes Software: http://www.fookes.com/
      > NoteTab website: http://www.notetab.com/
      > NoteTab Discussion Lists: http://www.notetab.com/groups.php
      >
      > ***
      > Yahoo! Groups Links
      >
      >
      >
      >
    • mycroft_b
      Thank you! The before the 2 worked. I didn t realize the $ values could go past 9 (one digit) and wouldn t have known about what to do anyway. And yes, I
      Message 2 of 4 , Oct 6, 2008
      • 0 Attachment
        Thank you! The \ before the 2 worked. I didn't realize the $ values
        could go past 9 (one digit) and wouldn't have known about what to do
        anyway. And yes, I had an extra 0 but it was just in my post.
        Thanks again.



        --- In notetab@yahoogroups.com, "David Smart"
        <smartware.consulting@...> wrote:
        >
        > Or put an extra backslash in to force the 2 to a literal, and thus
        separate
        > it from the $1 ...
        >
        > $1\2000$2
        >
        > BTW you have too many zeroes in your replacement expression - it
        currently
        > makes 20008 instead of 2008.
        >
        > Regards, Dave S
        >
        > ----- Original Message -----
        > From: "Alex Plantema" <alex.plantema@...>
        > To: <notetab@yahoogroups.com>
        > Sent: Saturday, October 04, 2008 7:07 AM
        > Subject: Re: [NTB] $1 in regular expression replace function not
        recognized
        >
        >
        > > Op vrijdag 3 oktober 2008 20:23 schreef mycroft_b:
        > >
        > >> I want to replace dates formatted as mm/dd/yy as mm/dd/yyyy.
        Example
        > >> 07/29/08 changes to 07/29/2008.
        > >>
        > >> I set up my search and replace as Reg Expr (\d\d/\d\d/)0(\d\s)
        and
        > >> replace with $12000$2.
        > >> I checked the box for Regular Expression.
        > > ...
        > >> It FINDS ok, but replaces this example with $12008. For some
        reason,
        > >> the first group ($1) is not recognized in the replace although
        the
        > >> second group ($2) is.
        > >
        > > It looks like NoteTab is confused because $1 is followed by a
        digit.
        > > But replacing (\d\d/\d\d)/0(\d\s) by $1/200$2 does work.
        > >
        > > Alex.
        > >
        > >
        > > ------------------------------------
        > >
        > > Fookes Software: http://www.fookes.com/
        > > NoteTab website: http://www.notetab.com/
        > > NoteTab Discussion Lists: http://www.notetab.com/groups.php
        > >
        > > ***
        > > Yahoo! Groups Links
        > >
        > >
        > >
        > >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.