----- Original Message -----
From: "Kevin Glynn" <[EMAIL PROTECTED]>
To: "Anthony Borla" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, May 06, 2006 3:21 AM
Subject: Re: Quick Regex Query
Kevin,
>>
>> On 4/30/06, Anthony Borla <[EMAIL PROTECTED]> wrote:
>> Greetings,
>>
<SNIP>
>>
>> The documentation states that the 'Regex.replace' signature is as
>> follows:
>>
>> {Regex.replace +TXT +RE +FUN ?RES}
>>
>> '+TXT' and '+RE' are fairly obvious, but what is the signature
>> of '+FUN' supposed to be ? All my attempts [guesses, actually]
>> have failed miserably,
>
> FUN takes the text (TXT) and a match description and returns
> new text to replace the matched text.
>
Thank you for the confirmation as it wasn't entirely clear from the
documentation.
>>
>> and the most 'successful' of these failed attempts simply blocks
>> [presumably waiting for a dataflow variable to bind ?]. A code
>> excerpt follows:
>>
>> Seq = {NewCell nil} Cre = {NewCell nil}
>> ...
>> Seq := "abcde\n12345\nABCDE\n"
>> Cre := {Regex.make "\n"}
>> ...
>> Seq := {Regex.replace @Seq @Cre fun {$ X Y} X end}
>>
<SNIP>
>>
>> I don't know why your example is blocking. It works for me.
>> Below is full example that should show you what is going on.
>>
<SNIP>
Thank you ever so much, Kevin, for both the analysis / regex example, and
the reassurance that I was essentially on the right track with the approach
taken.
I'll be revisiting this issue later in the week when I have a larger time
block to devote to it [I suspect I'll be needing it !], and will no doubt
have more related queries.
In the mean time I've posted a number of miscellaneous, but simpler, Oz
queries: I certainly couln't let a regex-related problem get in the way of
my Oz explorations :) !
Cheers,
Anthony Borla
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users