Article View: news.software.readers
Article #59782Re: [slrn] possible to use 'or' expression in s-lang regular expression?
From: John E. Davis
Date: Wed, 29 Mar 2000 00:00
Date: Wed, 29 Mar 2000 00:00
41 lines
2434 bytes
2434 bytes
On 29 Mar 2000 13:30:33 GMT, Thomas Schultz <tststs@gmx.de>
wrote:
>I think I see your point. It would not be possible to write portable
>programs using slang if the behavior of SLang_regexp_match et al.
>depended on a compile-time option of slang. Then, what about having
>_additional_ RegExp functions in slang which encapsulate pcre (or
>similar packages) where available and use the native slang routines
>otherwise?
Assuming that I understand what you are saying, this would not work
for several reasons:
1. A wrapper would be required that maps either the slang RE
syntax to pcre syntax, or visa versa.
2. The code using this new interface could only use the what is
supported by both slang and pcre, i.e., effective slang REs.
3. To get around the problem with #2, the application code could
use something like:
#v+
#if SLANG_HAS_PCRE
SLnew_re_interface (sophisticated RE);
#else
SLnew_re_interface (slang RE);
possibly_more_code ();
#endif
#v-
4. If one must put such code into the application, then why not
just use pcre directly:
#v+
#if USE_PCRE
pcre_whatever (...);
#else
SLang_regexp_match (...);
possibly_more_code ();
#endif
#v-
--John
Technical Details
Message-ID:
<slrn8e4g2n.ke9.davis@aluche.mit.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<slrn8dpjcj.9s1._hate_spam_thunder7@middle.of.nowhere> <slrn8dq0rs.h84.bluemoon@ux6.cso.uiuc.edu> <slrn8dqcuf.i6u.tststs@starflower.tststs.ddns.org> <slrn8dr094.9lh.davis@aluche.mit.edu> <slrn8dr2gg.4fi.thorfinn@netizen.com.au> <slrn8dsavg.l3l.tststs@starflower.tststs.ddns.org> <slrn8dsfk7.aud.davis@aluche.mit.edu> <slrn8e1gfk.9m.tststs@starflower.tststs.ddns.org> <slrn8e1pff.gpt.davis@aluche.mit.edu> <slrn8e41bp.12i.tststs@starflower.tststs.ddns.org>Show Full Headers
Complete Article Headers
Message-ID: <slrn8e4g2n.ke9.davis@aluche.mit.edu> Subject: Re: [slrn] possible to use 'or' expression in s-lang regular expression? Date: Wed, 29 Mar 2000 00:00:00 +0000 From: davis@space.mit.edu (John E. Davis) References: <slrn8dpjcj.9s1._hate_spam_thunder7@middle.of.nowhere> <slrn8dq0rs.h84.bluemoon@ux6.cso.uiuc.edu> <slrn8dqcuf.i6u.tststs@starflower.tststs.ddns.org> <slrn8dr094.9lh.davis@aluche.mit.edu> <slrn8dr2gg.4fi.thorfinn@netizen.com.au> <slrn8dsavg.l3l.tststs@starflower.tststs.ddns.org> <slrn8dsfk7.aud.davis@aluche.mit.edu> <slrn8e1gfk.9m.tststs@starflower.tststs.ddns.org> <slrn8e1pff.gpt.davis@aluche.mit.edu> <slrn8e41bp.12i.tststs@starflower.tststs.ddns.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 603942984 X-Trace: dreaderd 954351705 2961 18.75.2.45 Organization: Center for Space Research User-Agent: slrn/0.9.6.3 (Linux) Reply-To: davis@space.mit.edu Newsgroups: news.software.readers