Uli Kusterer wrote:
>use English-like filters instead of cryptic regexp filter strings. What about:
>
>find expression "<A HREF=" & some text & ">" & some text & "<" & some text
>& "</A>"
>put word 2 of the foundChunk into startFirstMatch
>put word 4 of the foundChunk into endFirstMatch
>-- do something with it
>
> This is still not satisfactory, but a lot more readable than regexp "<a
>href=(.+?)� .*?>.*?</a>". Another addition to the above could be allowing
>an integer, a number, <n> character[s] etc. besides "anything". So, the
>formal syntax could be:
>
>find expression <descriptor>
>
>where descriptor would be one of:
>
>       <descriptor> & <descriptor>
>       <descriptor> && <descriptor> (same as <descriptor> & " " &
><descriptor>)
>       some text -- Wildcard
>       an integer [between <a> and <b>]
>       a number [between <a> and <b>]
>       <n> character[s]
>       <string>
>
>It's a syntax that can actually be parsed by both computer and human, and
>it uses the "&" operator in a logical way. But this still kind of 
>"overloads" & and &&, so if anyone has a better idea?

Now this sounds like a cool proposal, and I don't think it overloads 
the "&" and "&&", it is only moving into the direction of a logical 
"and". I'd prefer "a string" over "some text" though for homogenity. 
But if you have wildcards, you'll want to have access to them:

  find "<A HREF=" & a string & ">" & a string & "</A>"

  put the first found chunk into theUrl
or
  put foundChunk(-1) into theText

or should you name the wildcard chunks

  find "<A HREF=" & a string theUrl & ">"...

These things can also be referred to within the find command itself:

  find "<"& a word tagName & ">" & a string theBody & "</" & tagName & ">"

We also may need characters out of a set of characters

  an item of "one,two,three"
  a character in "([{<"

and things get hairy if you want to find the matching braces, but 
that is hairy in regexp as well. Alternative finds would be easier to 
read:

  find "(" & a string txt & ")" or "[" & a string txt & "]" or ...

This could be a fine replacement for the matchChunk function in MC.


Regards
   R�diger
--------------------------------------------------------------------
| Ruediger zu Dohna   GINIT GmbH   0721-96681-63    [EMAIL PROTECTED] |
| PGP-Fingerprint: F1 BF 9D 95 57 26 48 42 FE F8 E8 02 41 1A EE 3E |
--------------------------------------------------------------------

Reply via email to