reg ex expression - finding long character strings

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lawrence

    reg ex expression - finding long character strings

    This reg ex will find me any block of strings 40 or more characters in
    length without a white space, yes?

    [^ ]{40}


    To get it to include tabs and newlines, do I to this?

    [^ \n\t]{40}
  • Garp

    #2
    Re: reg ex expression - finding long character strings


    "lawrence" <lkrubner@geoci ties.com> wrote in message
    news:da7e68e8.0 405300907.3c8ea bf7@posting.goo gle.com...[color=blue]
    > This reg ex will find me any block of strings 40 or more characters in
    > length without a white space, yes?
    >
    > [^ ]{40}
    >
    >
    > To get it to include tabs and newlines, do I to this?
    >
    > [^ \n\t]{40}[/color]

    \s is the whitespace token, if that's easier for you.

    Garp


    Comment

    • John Dunlop

      #3
      Re: reg ex expression - finding long character strings

      lawrence wrote:
      [color=blue]
      > This reg ex will find me any block of strings 40 or more characters in
      > length without a white space, yes?
      >
      > [^ ]{40}[/color]

      That matches exactly forty consecutive characters excluding spaces.
      [^ ]{40,} matches forty or more.
      [color=blue]
      > To get it to include tabs and newlines, do I to this?
      >
      > [^ \n\t]{40}[/color]

      That's one way. Perhaps the \S character type, which stands for any
      character that isn't a whitespace character, would be useful.

      --
      Jock

      Comment

      Working...