Anthony Borla writes:
> >
> > but have you tried the Regex module?
> >
>
> Funny you should ask that. I'd *started* to look at this module, but ran
> into problems [not related to the current program] using things like
> 'Regex.replace' and 'Regex.forAll', and unable to solve them, shelved the
> attempt for a later time [besides, plenty of other Oz aspects to explore].
>
> I don't suppose you've got a couple of simple examples of these routines
> laying around ;) ! There're definitely no examples in either the
> documentation or mailing list archive [I just searched using the link you
> gave below].
>
You are right, I haven't used it before either but maybe this is a
start:
declare
[Regex] = {Module.link ['x-oz://contrib/regex']}
DigitsRE = {Regex.make '[[:digit:]]+'}
Str = " regex 58 99"
{Browse {Map {Regex.allMatches DigitsRE Str}
fun {$ match(0:S#E)}
{Int.toFloat {String.toInt
{ByteString.toString {ByteString.slice
{ByteString.make Str} S E}}}}
end
}}
You will have to get over your fear of multiple type translations
though ;-)
k
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users