Re: Kat: parse() Question

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 13 Oct 2004, at 14:47, cklester wrote:

> 
> 
> posted by: cklester <cklester at yahoo.com>
> 
> No, I haven't checked the docs yet... :)
> 
> If I have a string like this:
> 
>    "23 '17-5' 14 86"
> 
> can I parse on the spaces and have the single-quoted items come back
> as one item?

No.

> So, for instance, this string
> 
>    "One Two 'Three Four' Five 'Six Seven Eight'"
> 
> would parse to
> 
>    { "One", "Two", "Three Four", "Five", "Six Seven Eight" }
> 
> I'm sure you've got a function for that... Can you help me out here?!

No. But that looks simple enough that finding the include to handle it would 
take longer than re-writing it occasionally. For instance, you could replace all
the " " in the single-quotes with "_", and then parse would do what you want. 
In my experience, the way humans handle punctuation is riddled with errors. 
Parse(), or any function that calls it, can return the separators you specify, 
and i did that so i could recover from human error. In the return, the 
separators will be in their own lil sequence, where they were in relation to the
real tokens.

Kat

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu