[e-lang] Poll: Adding regular expression objects to the standard library

Kevin Reid kpreid at switchb.org
Mon May 30 22:12:54 PDT 2011


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/>




More information about the e-lang mailing list