[Omake] String manipulation
Jason Hickey
jyh at cs.caltech.edu
Tue Aug 7 13:45:55 PDT 2007
Jared,
I'd like a "subst" function too--we need to add one. In the
meantime, there is more you can do. In addition to using "match" as
Aleksey suggested, there is also a function "lex-string" that might
help. Also, the function "open-in-string" can be used to create a
channel from a string.
I have attached some code for a generic substitution function subst
(<from-regex>, <replacement>, <string>). Still no help with case-
insensitive substitutions though:(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: subst.om
Type: application/octet-stream
Size: 996 bytes
Desc: not available
Url : http://lists.metaprl.org/pipermail/omake/attachments/20070807/312ecb7e/subst.obj
-------------- next part --------------
Jason
On Aug 6, 2007, at 3:41 PM, Aleksey Nogin wrote:
> Jared,
>
> Do you know about the match function? See http://omake.metaprl.org/
> omake-language.html#section:match and http://omake.metaprl.org/
> omake-base.html#function:match
>
> This should give you most of the regexp-based matching and
> substitution (except no easy support for case-insensitive matching).
>
> Aleksey
>
> On 06.08.2007 13:08, Jared C. Davis wrote:
>
>> Hi,
>> Would it be possible to get some string-manipulation routines like
>> regular-expression based pattern matching and substitution added to
>> omake?
>> It might be that I should be able to write my own using fsubst, but
>> that seems to be intended for files, and it didn't seem to support
>> case-insensitive matching. I think my other option is to use
>> programs
>> like sed, but it seems sort of gross to be calling out to system
>> programs to do string manipulation, and one of the things I really
>> like about OMake is how I typically don't have to rely on system
>> programs, because commands like "rm" and "cat" are built in.
>> Thanks!
>> Jared
>
>
> --
> Aleksey Nogin, Research Scientist
> Advanced Technologies Department, Information & System Sciences Lab
> HRL Laboratories, LLC, Malibu, CA
> _______________________________________________
> Omake mailing list
> Omake at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake
--
Jason Hickey http://www.cs.caltech.edu/~jyh
Caltech Computer Science Tel: 626-395-6568 FAX: 626-792-4257
More information about the Omake
mailing list