| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | [TSEPro] Re: regular expressions |
From: Michael Graham
@Date: Fri, 07 Mar 2003 13:45:15 -0500
@Sender: semware-owner{at}sawasdi.apana.org.au
There's a macro on Semware's site that searches for two words, even if
they are split by a line break:
http://www.semware.com/files/tse-pro/locater.zip
I don't know how flexible it is.
It would be an interesting exercise to program a (simple) regular
expression engine in SAL, using GetText() and NextLine(). Such a beast
could, for instance:
* search across lines
* search for nested structures (e.g. with parens, brakets, or )
I would be interested to see how fast it would be. Certainly not as
fast as the internal searches, but maybe fast enough for certain
purposes?
Michael
On Thu, 6 Mar 2003 17:18:17 -0800
"Greg Macdonald" wrote:
>
> Define "in one line".
>
> With more complex searches, it occurs to me that the goal is really more
> logical content centric than line centric and the condition should be "in
> one sentence or paragraph".
>
> On the other hand, even a paper clip is inadequate if you have too many
> pieces of paper.
>
> Greg
>
> ----- Original Message -----
> From: "Michael Fisher"
> To: "TSE Mailing List"
> Sent: Thursday, March 06, 2003 16:26
> Subject: [TSEPro] Re: regular expressions
>
>
> >
> > Dave,
> >
> > >I started a very similar response, but realized that with
> > >AND, stringa and stringb could be in any order. It took me
> > >a bit, but I believe the following would do it. Note that
> > >it is untested, however.
> > >{{stringa}.*{stringb}}|{stringb}.*{stringa}}
> >
> > Good idea, the same thought came to me only after I had
> > sent my answer - as usual in life, we become wise only
> > after the event ...
> >
> > However, for the desired effect, you have to add one more
> > "{" to your pattern, after the "|":
> >
> > {{stringa}.*{stringb}}|{{stringb}.*{stringa}}
> >
> > I'm beginning to think that a logical "AND" may after all be
> > needed. Imagine you are searching for 3 patterns in one
> > line.
> > It could be: string1 string2 string3
> > But also: string2 string1 string3
> >
> > Then constructing such a "this way OR the other way round"
> > search string will become imposssible - it would be far to
> > long and complicated.
> >
> > Anyone knows a way out of this dilemma?
> >
> >
> > --
> > TSEPro Mailing List
> > List Maintenance: www.semware.com/html/list.htm
> >
> >
> >
>
>
> --
> TSEPro Mailing List
> List Maintenance: www.semware.com/html/list.htm
--
Michael Graham
magog{at}the-wire.com
--
TSEPro Mailing List
List Maintenance: www.semware.com/html/list.htm
---
[sawasdi.apana.org.au] (3:800/846.13)
* Origin: apana>>>>>fidonetSEEN-BY: 633/267 270 @PATH: 800/846 1 640/954 774/605 123/500 106/2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.