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

22574Re: [NTB] Remove x number of characters from a line of text

Expand Messages
  • elibrarian22
    May 28, 2012
    • 0 Attachment
      Why all this stuff about 1, 2, 3 or four digits?

      This one should take care of any number of digits being at the end of a line, after after a space (including the space):

      \x20\d*?$

      that is:

      \x20 = space
      \d = digit
      * = any number of, including none
      ? = make the previous expression non-greedy
      $ = must be at the end of a line

      regards,

      Kim

      --- In notetab@yahoogroups.com, Alec Burgess <buralex@...> wrote:
      >
      > Boy, lots of people up late on Memorial Day, (I'm in Canada so its just
      > a regular Sunday night/early morning for me.
      > Re: anchor. Yes John had it on his examples, I forgot it on mine :-(
      > So it s/b Find= \x20\d{2,3}$
      >
      >
      > On 2012-05-28 00:44, Alan G wrote:
      > > On Sun, 27 May 2012 23:22:00 -0400, you wrote in part:
      > >
      > > > John is of course correct but for the specific case you described -
      > > > space followed by two or 3 digits you want:
      > > > Find=\x20\d{2,3}
      > > > Replace = (i.e. leave empty)
      > > > with regex find turned on.
      > > >
      > > > For an idea of some of the other things it will do for you:
      > > > Help-Help on Regular Expressions-Syntax Quick Reference
      > >
      > > I can't write a RegEx myself, but the problem didn't preclude such
      > > strings occurring internal to a line. To meet the requirement of the OP
      > > won't the RegEx have to be anchored to end of line?
      >
    • Show all 22 messages in this topic