home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.rexx
- Path: sparky!uunet!noc.near.net!ns.draper.com!news.draper.com!MVS.draper.com!SEB1525
- From: SEB1525@MVS.draper.com (Steve Bacher)
- Subject: Regular expression syntax
- Message-ID: <19920908084344SEB1525@MVS.draper.com>
- Sender: MVS NNTP News Reader <NNMVS@MVS.draper.com>
- Nntp-Posting-Host: mvs.draper.com
- Organization: Draper Laboratory
- Date: Tue, 8 Sep 1992 13:43:00 GMT
- Lines: 34
-
- Now that the idea has been seriously suggested, why don't we try to
- come up with a nice REXXy syntax for regular expressions?
-
- In the REXX tradition, it should be readable: i.e. wordy and with
- minimal use of special characters.
-
- How about this to kick off a discussion...
-
- Unix-style regexp Proposed REXX-style expression
-
- abc "abc"
- a.c "a" ANY "c"
- a* ZERO_OR_MORE("a")
- a.* "a" ZERO_OR_MORE(ANY)
- a[bc]d (them's sq. brackets) "a" ("b" OR "c") "d"
- ^abc BEGIN "abc"
- abc$ "abc" END
-
- Then we could have a function MATCH(string,pattern) where pattern
- is a regexp as above. And we could have PARSE PATTERN pattern WITH...
-
- Maybe we need to separate the pattern elements with commas, or
- surround the whole thing in a REGEXP(...) pseudofunction call.
- Should patterns be evaluated like other REXX expressions, or
- do we need a special syntax for run-time pattern generation
- a la parentheses in PARSE?
-
- Well, you get the idea. Remember, verbosity is not a bad thing
- in REXX. I'm sure that youse can come up with something better
- if you try.
-
- --
- Steve Bacher (Batchman) Draper Laboratory
- Internet: seb@draper.com Cambridge, MA, USA
-