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

Re: [NTB] Regexp says this doesn't work

Expand Messages
  • Alec Burgess
    Hi Bob: Notetab regexp s have a problem with character classes using d (inside [ and ]) Try: b+[0-9 -]+ b+[0-9 -]+ b+[0-9 -]+ b+ d+$ This expression found in
    Message 1 of 2 , Apr 19, 2004
    • 0 Attachment
      Hi Bob:

      Notetab regexp's have a problem with character classes using \d (inside [
      and ])
      Try:
      \b+[0-9\-]+\b+[0-9\-]+\b+[0-9\-]+\b+\d+$
      This expression found in turn each of the three examples you provided. - I
      didn't check carefully to see if it also finds things it shouldn't :-)
      I replaced all occurances of [\d by [-9 - the trailing \d (outside a
      character class) does not appear to be a problem.

      From Help:
      Note - as I read it \d *should* work. I'm not sure what other specials if
      any also fail.

      >>A string enclosed in brackets [] specifies a character class. Any single
      character in the string is matched. For example, [abc] matches an a, b, or
      c. Ranges of ASCII letters and numbers can be abbreviated as, for example,
      [a-z0-9]. If the first symbol following the [ is a caret (^) then a negative
      character class is specified. In this case, the string matches all
      characters EXCEPT those enclosed in the brackets. For example, [^a-z]
      matches everything except lower case characters (and newlines).

      The special characters defined above may be used inside of character classes
      with the exception of \n, \w and \h, which are shorthand for their own
      character classes. If the characters - or ] are to be used literally inside
      of a character class, they should be preceded by the escape character \.
      Note that *?+(){}!^$#& are not special characters when found inside a
      character class.<<

      Regards ... Alec
      --

      ---- Original Message ----
      From: <bob.in.jersey@...>
      To: <notetab@yahoogroups.com>
      Sent: Monday, April 19, 2004 17:08
      Subject: [gla: [NTB] Regexp says this doesn't work

      > Search string:
      > \b+[\d\-]+\b+[\d\-]+\b+[\d\-]+\b+\d+$
      >
      > Examples of what I'm expecting it to find:
      > 14 -- -- 2
      > 13 18 26 6
      > 18 19 -- 3
      >
      > The numbers in the first three columns could be 1-100.
      > The last I know to not be over 100.
      >
      > It can't find anything given the above string.
      >
      > Ideas?
    • bob.in.jersey@juno.com
      ... OK, this did the trick. Thanks! -- BOB dot in dot jersey at Juno dot com
      Message 2 of 2 , Apr 20, 2004
      • 0 Attachment
        On Tue, 20 Apr 2004 01:51:41 EDT, "Alec Burgess" wrote, in part:
        > Notetab regexp's have a problem with character classes using \d
        > (inside [ and ])
        > Try:
        > \b+[0-9\-]+\b+[0-9\-]+\b+[0-9\-]+\b+\d+$
        > This expression found in turn each of the three examples you
        > provided. - I didn't check carefully to see if it also finds
        > things it shouldn't :-)

        OK, this did the trick. Thanks!



        --
        BOB dot in dot jersey at Juno dot com
      Your message has been successfully submitted and would be delivered to recipients shortly.