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

509RE: [NTS] regular expression to find anything up to two spaces in a row ...

Expand Messages
  • John Shotsky
    Jun 18, 2011
    • 0 Attachment
      Negative classes work by individual characters only. You could change any instance of two spaces to a token character,
      then negate class that, but that's probably even more work.



      <http://recipetools.gotdns.com/> RecipeTools site

      <http://groups.yahoo.com/group/RecipeTools/> RecipeTools Yahoo group

      <http://shotsky.gotdns.com/index.htm> Beaverton Weather

      From: ntb-scripts@yahoogroups.com [mailto:ntb-scripts@yahoogroups.com] On Behalf Of Don
      Sent: Saturday, June 18, 2011 09:26
      To: ntb-scripts@yahoogroups.com
      Subject: Re: [NTS] regular expression to find anything up to two spaces in a row ...

      Hi Axel,

      It is part of a longer expression. It is on a single line.
      (.+?) {2,}

      Don't know why I was struggling I guess ... other than I was trying to
      say "anything but two spaces". This works fine -- but is there a way to
      actually say anything but two spaces? Things inside of [ and ] continue
      to baffle me at the moment. How do I say not something specific?

      Thank you for the prompt help!

      On 6/18/2011 11:21 AM, Axel Berger wrote:
      > Don wrote:>
      >> I want to find and capture everything and anything unless until I
      >> encounter two spaces in a row ...
      > You don't specify how general you need it to be. There may be more than
      > one of those several space markers or none and the marker may be more
      > than two spaces in a row. And you will need to find more than one line,
      > I think. This caters for all of these:
      > ^!Jump TEXT_START
      > :loop
      > ^!Find "(?s)(.+?)( {2,})" RSTI1
      > ^!IfError rest
      > ^!Continue
      > ;^!MoveCursor 2
      > ^!Find "(?s)( {2,})" RSTI
      > ^!Jump SELECT_END
      > ^!Goto loop
      > :rest
      > ^!Find "(?s)(.+)" RSTI
      > ^!Continue
      > Axel
      > ------------------------------------
      > Fookes Software: http://www.fookes.com/
      > NoteTab website: http://www.notetab.com/
      > NoteTab Discussion Lists: http://www.notetab.com/groups.php
      > ***
      > Yahoo! Groups Links

      [Non-text portions of this message have been removed]
    • Show all 13 messages in this topic