Lisp HUG Maillist Archive

PPCRE

.... also, I a bit of a lamer when it comes to RE's. I know the standard regular expression syntax, well enough to have found that my notions worked in PPCRE. But there are several patterns in there denoting, e.g., 3 repetitions of [0-9] that probably have a better syntax for expressing a repetition in the pattern. E.g., instead of [0-9][0-9]? for one or two, there might be a syntax like [0-9]{1-2} ?? And [0-9][0-9][0-9][0-9] for 4 reps might be [0-9]{4} ??

Anyone is welcome to improve the patterns. Let me know too what the improvements are...

Dr. David McClain
Chief Technical Officer
Refined Audiometrics Laboratory
4391 N. Camino Ferreo
Tucson, AZĀ  85750

email: dbm@refined-audiometrics.com
phone: 1.520.390.3995
web: http://www.refined-audiometrics.com



Re: PPCRE

On Thu, Mar 19, 2009 at 4:44 PM, David McClain
<dbm@refined-audiometrics.com> wrote:
> E.g., instead of [0-9][0-9]? for one or two,
> there might be a syntax like [0-9]{1-2} ?? And [0-9][0-9][0-9][0-9] for 4
> reps might be [0-9]{4} ??

Yep, that would be [0-9]{1,2} (note comma) and [0-9]{4}.  CL-PPCRE
implements most of what "man perlre" explains.

Edi.


Updated at: 2020-12-10 08:41 UTC