home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / vmsnet / tpu / 558 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  1.5 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!mccall!infopiz!decwrl!pa.dec.com!e2big.mko.dec.com!nntpd.lkg.dec.com!augie!reinig
  2. Newsgroups: vmsnet.tpu
  3. Subject: Re: Pattern
  4. Message-ID: <1992Dec30.215500.4383@nntpd.lkg.dec.com>
  5. From: reinig@augie.enet.dec.com (August Reinig)
  6. Date: Wed, 30 Dec 1992 21:55:00 GMT
  7. Reply-To: reinig@augie.enet.dec.com (August Reinig)
  8. Sender: reinig@augie (August Reinig)
  9. References: <1hsqeoINNmqe@usenet.INS.CWRU.Edu>
  10. Organization: Digital Equipment Corporation
  11. Lines: 30
  12.  
  13. >I came up with the following patterns:
  14. >
  15. >predig:=span('0123456789');            <--- for aaaa
  16. >posdig:=anchor&span('0123456789');        <--- for bbbb
  17. >per:='.';                    <--- for .
  18. >exp:=anchor&(notany('dD')|line_end);        <--- for X
  19. >
  20. >find :=((predig&per&exp)|(per&posdig&exp)|(predig&per&posdig&exp));
  21. >
  22. >However the above does detect numbers like 123.12D00, ie if I have more than >one digit after the period followed by D.
  23.  
  24. What version of TPU?  I haven't examined this in detail but your patterns look ok.  Why not try:
  25.  
  26.  ( (span("0123456789") + "."                      + notany("dD")) ! aa.X
  27.  | (span("0123456789") + "." + span("0123456789") + notany("dD")) ! aa.bbX
  28.  | (                     "." + span("0123456789") + notany("dD")))!   .bbX
  29.  
  30. and report the results.
  31.  
  32. You can use partial pattern assignment on your patterns to see who is matching what.
  33.  
  34. ----
  35.  
  36. > how do I put a cursor on the end of a range?
  37.  
  38. position(end_of(<range>));
  39.  
  40.                 August
  41.                 (former TPU developer, patterns were
  42.                  my specialty)
  43.