Poll: Adding regular expression objects to the standard library
Kevin Reid <kpreid-M/[email protected]> Mon, 30 May 2011 22:12:54 -0700
| Newsgroups | gmane.comp.lang.e.general |
|---|---|
| Message-ID | <[email protected]> |
E currently has the rx`` quasi-parser for pattern matching, as Bob knows. However, unlike typical regular expression facilities, rx`` always performs an *anchored* match, because it is used as part of E's destructuring patterns. This results in messy notation when one wants to actually perform a search, and most likely, more inefficient use of the underlying regular expression engine. I propose that rx`...` occurring as a *value*, rather than a pattern, should yield a regular expression object, which will provide an interface to perform the traditional search, split, and other operations familiar from other languages. Questions: 1. Does this seem like a good idea overall? Any comments? 2. What existing systems should I study to determine the regular expression object interface and features? The list that comes to mind Perl, JavaScript, CL-PPCRE (Common Lisp), and possibly Python. -- Kevin Reid <http://switchb.org/kpreid/>